Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New-DcnImage] Couldn't connect to host remotely. #223

Closed
tcartwright opened this issue Feb 16, 2023 · 2 comments
Closed

[New-DcnImage] Couldn't connect to host remotely. #223

tcartwright opened this issue Feb 16, 2023 · 2 comments

Comments

@tcartwright
Copy link

tcartwright commented Feb 16, 2023

Getting issues trying to connect to a remote server.

Setup:
dbaclone - 0.10.72
dbatools - 1.1.145
PSFramework - 1.7.270
Microsoft SQL Server 2019

I ran this:

Set-DcnConfiguration -InformationStore File -Path "\\servername\dbaclone\" -Force

Then I ran this:

New-DcnImage -SourceSqlInstance "servername" `
    -DestinationSqlInstance "servername" `
    -ImageNetworkPath "\\servername\dbaclone\images" `
    -Database SaveMoney_Log `
    -CreateFullBackup `
    -CopyOnlyBackup 

And I recieved:

WARNING: [15:40:02][New-DcnImage] Couldn't connect to host remotely.
Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer

I tested WinRM using this command

Test-WSMan -ComputerName "serverName"

and got:

wsmid           : http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd
ProtocolVersion : http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
ProductVendor   : Microsoft Corporation
ProductVersion  : OS: 0.0.0 SP: 0.0 Stack: 3.0

So, it appears that WinRM is working remotely, but it appears that the code cant connect remotely. Help?

@tcartwright
Copy link
Author

I then remoted into the server and created some images locally. However, when I try to create clones from the remote machine using this script I get the following error.

New-DcnClone -SqlInstance "destinationServer" -CloneName name -Database new db -LatestImage 
WARNING: [15:55:09][Get-DcnImage] Could not reach image information location 'DCNJSONFolder:\'
WARNING: [15:55:09][New-DcnClone] There is no image for database 'SaveMoney'

@tcartwright
Copy link
Author

  • I switched to using sql instead of json once I figured out how the configuration worked.
  • Then I also figured out that PS Remoting has to be enabled both on every single SQL server you connect to.

The help could be beefed up more to explain these things, which would be beneficial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant