Hi All,
I'm currently having an issue with the Set-VMGuestNetworkInterface using Powershell. Below is the command I'm running...
Get-VM -Name Server01 -Server DC1-VC1 | Get-VMGuestNetworkInterface -GuestUser ".\administrator" -GuestPassword $Password | Where {$_.Name -like "Local Area Connection*"} | Set-VMGuestNetworkInterface -IPPolicy static -GuestUser ".\administrator" -GuestPassword $password -Ip "10.10.10.1" -Netmask "255.255.255.0" -Gateway "10.10.10.254" -Dns "10.10.10.100","10.10.10.50"
This is the error I get..
Set-VMGuestNetworkInterface : 3/12/2014 3:22:29 PM Set-VMGuestNetworkInterface "Error occured while configuri
ng the network:'The RPC server is unavailable.
'.
At line:1 char:208
+ Get-VM -Name Server01 -Server DC1-VC1 | Get-VMGuestNetworkInterface -GuestUser ".\administrator" -GuestPasswor
d $Password | Where {$_.Name -like "Local Area Connection*"} | Set-VMGuestNetworkInterface <<<< -IPPolicy static -Gues
tUser ".\administrator" -GuestPassword $password -Ip "10.10.10.1" -Netmask "255.255.255.0" -Gateway "10.10.10.254" -Dns
"10.10.10.100","10.10.10.50"
+ CategoryInfo : InvalidArgument: (:) [Set-VMGuestNetworkInterface], ViError
+ FullyQualifiedErrorId : Client20_VmGuestService_SetVmGuestNetworkInterface_Error,VMware.VimAutomation.ViCore.Cmd
lets.Commands.SetVmGuestNetworkInterface
The above error message, in particular "The RPC server is unavailable." would lead me to believe that it can't talk to the server at all, and this would make sense... however the above command does update both DNS settings to the ones specified in the script. Has anyone seen this before? I've had a look around and can't see any previous people that have had this issue.
This is an output of the network adapter list...
Get-VM Server01 -Server DC1-VC1 | Get-VMGuestNetworkInterface -GuestUser ".\administrator" -GuestPassword $Password | Where {$_.Name -like "Local Area Connection*"}
VM Name IP IPPolicy SubnetMask
-- ---- -- -------- ----------
Server01 Local Area Connection 3 Static
I don't think I need to use the host username/password settings too as it's using vCenter, I tried with it anyway with no change.
If I run the same command but only specify IP, or Gateway, or Netmask it's still the same result.
I've removed the test server from the domain to make sure it isn't some strange policy but the results are the same, the administrator account I'm using is a local admin account with full permissions.
I've tried allowing all remote-script execution on Server01 too with no change. The firewall is turned of, RPC service is started etc. VMWare tools is installed correctly.
Cheers,
Michael.