• This topic has 5 replies, 2 voices, and was last updated April 4, 2019 by Hosted S.

DR from Hyper-V to VMware

  • Hi,

    We are using Zerto to replicate from Hyper-V to vSphere. There were a few challenges to overcome as we need to re-ip so had to install VMware tools on the production hyper-v servers. I am trying to resolve a couple of issues using a powershell post failover script. One of the issues is that vmtools is triggering a lot of alerts in production so we want to set them as manual and leave them stopped. I want the powershell script to start the vmtools post failover so the re-ip happens and then disable the firewall in case the network adapter registers as a guest or private network.

    This is the powershell script that works locally:

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force

    start-transcript -Path C:\Scripts\log.txt

    ## Start VMTools Service
    Start-Service vmtools

    ## Disable Windows Firewall – All Profiles
    Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
    stop-transcript

    The script isn’t working through Zerto, How is the script passed to the VM? The vm isn’t on the network at this stage and the vmtools aren’t running, can this work?

    Any help very much appreciated.

    Hello – pre/post recovery scripts are ran from the ZVM where the VM is recovering to as mentioned here in the ZVM docs. To interact within the recovered guest, the script would need to be written to do that – for example, via a tool like the invoke-vmscript powercli cmdlet (in cases where  the ZVM does not have network access to the recovered VM) or the built-in powershell cmdlet new-pssession (in cases where the ZVM can access the network the recovered VM is on).  — Justin

    Thanks Justin.

    Okay, so it seems i need a new plan. invoke-vmscript powercli requires the vmtools to be running and i need the script to start them. There is no network until the tools start so cant use new-pssession.

    Does anyone have any suggestions?

    I think I have a solution. I placed a powershell script on the host in production and scheduled it to run on startup. It checks for a vmware network adapter and runs the required commands. On a hyper-v host it does nothing.

    $adapter = get-netadapter | select InterfaceDescription

    if($adapter -like ‘*vmxnet*’) {

         

    Start-Service vmtools

    Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False

    } else {

    Exit

    }

    Wouldn’t let me post in one go!!

You must be logged in to create new topics. Click here to login