PowerCLI

 View Only
  • 1.  Copy VM Notes to Replica

    Posted Sep 24, 2024 02:09 PM

    Hey all,
    I am trying to find a way to copy VM notes to the replica that is made of it. How is the easiest way to do this?



  • 2.  RE: Copy VM Notes to Replica

    Posted Sep 25, 2024 03:38 AM

    Are you talking about a Replica made with Disaster Recovery or something else?



    ------------------------------


    Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference


    ------------------------------



  • 3.  RE: Copy VM Notes to Replica

    Posted Sep 25, 2024 01:08 PM

    Yes, so it will be <NAME> and <NAME>_replica




  • 4.  RE: Copy VM Notes to Replica
    Best Answer

    Posted Sep 26, 2024 03:15 AM

    If your DR is set up with 2 vCenters, you could do something like this

    Get-VM -Server $vc1 -PipelineVariable vm |
    ForEach-Object -Process {
        Get-VM -Name "$($vm.Name)_replica" -Server $vc2 |
        Set-VM -Notes $vm.Notes -Confirm:$false
    }


    If you only use 1 vCenter with DR you can leave out the Server parameter.



    ------------------------------


    Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference


    ------------------------------