Using vSphere Replication and VMware SRM to Clone a VM to a Remote vCenter

I was given the task of cloning some servers to a different vC. I thought it was a perfect opportunity to download and use the Cross vC Tool, but the environment didn’t meet the requirements.

 

Option 1 – We do have vSphere Replication and VMware SRM

  • Once the VM is protected, we’ll run a test and clone the test box.

Option 2 – Clone or create a template of each VM and deploy to other site.

  • Not difficult, but we don’t want to cause alerts for using up the bandwidth.

 

Needless to say, I chose Option 1.

Environment

  • vC 6.5u3 at both sites
  • ESXi 6.5
  • vSphere Replication 8.1
  • VMware SRM 8.1

 

Scenario

I created a new, tiny VM for this example.

  • Notes
    • No network attached
    • *No OS installed
      • No VM Tools installed

 

Machine generated alternative text: Edit Settings Franky Rep Test Virtual Hardware Memory > Hard disk I > SCSI controller O CD,'DVD drive 1 > Video card VMCI device SATA controller O VM Options ADD NEW DEVICE VMware Paravtrtual Client Device Specify custom settings v Device on the virtual machine bus that pruides support for the virtual möcl-ine communication interface APC' Additional Hardware CANCEL

Let’s protect it with vSphere Replication

 

  • Actions
    • All Site Recovery actions
      • Configure Replication

 

Machine generated alternative text: Franky Rep Test Summary Monitor Permissions ACTIONS Rep Datast Configure Guest as: Ccrnpatibility: VMware Tools: DNS Name: Addresses: VMware Photon OS (64 Guest OS ESXi and later (VM Not running. not install Snapshots More into Open Remote Console

 

Machine generated alternative text: - Rep Guest OS Snapshots Open Remote Console Migrate.„ Cane Fault Tolerance VM Policies Template Compatibility Export System Logs.. Edit Settings_ Move to folder Rename. Edit Notes. Tags & Custom Attributes Add Permission.. Al.arms Remove from Inventory Delete from Disk HCX Actions Update Manager Site Recovery actions t prcmides support for the virtu Configure Replication_ Reconfigure Repicetion„

 

Will get prompted for credentials

Machine generated alternative text: vmware VMware•vCenter Single Sign-On

 

Machine generated alternative text: Site Recovery

 

Config Time

Machine generated alternative text: Configure Replication Franky Rep Test 1 VM validation 2 Target site 3 Target datastore 4 Replication settings 5 Protection group 6 Ready to complete VM validation Validation checks which VMS can be configured tor replication. X REMOVE AL_ VVS WIT* ISSUES Franky Rep Test Status v' OK CANCEL 1 VIM(s) NEXT

 

Choose where this VM should end up.

  • Will have to sign into Target site, if not already done
  • My environment doesn’t have Linked vC’s

Machine generated alternative text: Configure Replication Franky Rep Test 1 VM validation 2 Target site 3 Target datastore 4 Replication settings 5 Protection group 6 Ready to complete Target site Select the target site where the virtual machine will be replicated. Target Site O Status m Not logged in Logged in You must login to the target site. LOGIN CANCEL SACK 2 site(s) NEXT

 

Machine generated alternative text: Log In Site Enter vCenter Server credentials x vCenter Server user name Password Enter user name Enter password CANCEL

 

Should now show up as Logged In

  • Choose or Auto-assign if you only have 1 vSphere Replication server

Machine generated alternative text: Configure Replication Franky Rep Test 1 VM validation 2 Target site 3 Target datastore 4 Replication settings 5 Protection group 6 Ready to complete Target site Select the target site where the virtual machine will be replicated. Target Site o Select the vSphere Replication server that will handle the replication O Auto-assign vSphere Replication Server C) Manually select vSphere Replication Server O —l (embedded) Status V Logged in Logged in Replications CANCEL 2 site(s) I replication server(s) SACK NEXT

 

Choose your storage at the Target site

  • For those wondering, we won’t be using a seed
    • This could come into play if the Target site had a VM Folder with our VM files and we just needed to replicate the updated blocks.
    • More info

Machine generated alternative text: Configure Replication Franky Rep Test 1 VM validation 2 Target site 3 Target datastore 4 Replication settings 5 Protection group 6 Ready to complete Target datastore Select a datastore for the replicated files. Virtual machine 'Franky Rep Test' is currently using 1.12 Ga. Disk format: Thin provision VM storage policy: Datastore Default Capacity o o o o o o o o o o o o o o Select seeds Configure datastore per disk Type 21 datastore(s) CANCEL BACK NEXT

 

Screen if choosing “Select seeds”

  • vSphere Replication searches the Target site for any disk(s) with an identical filename. If this is a new replication, you should see “none”

Machine generated alternative text: Configure Replication Franky Rep Test 1 VM validation 2 Target site 3 Target datastore 4 Select seed 5 Replication settings 6 Protection group 7 Ready to complete Select seed Review the suggested replication seeds and change them it necessary Unintended use of replication seeds might lead to data loss! Search seeds tor the whole virtual machine in folder: none Name disk I O Seed nonev none Cl The selected seeds are correct CANCEL BACK NEXT

 

Some considerations here

  • RPO
    • This can be updated at any time
    • Setting depends on business case
  • Point in Time instances
    • This is only a demo, so don’t need to keep many copies
    • Depends on business case
  • Quiescing
    • Not available because there are no VM Tools installed on my server
  • Compression
    • Be cautious here
    • I’d recommended if
      1. Your environment has the extra CPU available on the ESXi Host/cluster
      2. Bandwidth between sites isn’t plentiful

 

Machine generated alternative text: Configure Replication Franky Rep Test 1 VM validation 2 Target site 3 Target datastore 4 Replication settings 5 Protection group 6 Ready to complete Replication settings Configure the replication settings for the virtual machine. Recovery point objective (APO) @ 5 minutes 20 hours Enable point in time instances O 24 hours Keep 1 instances per day tor the last 7 days It the APO period is longer than 24 hours. you might want to decrease the RPO value to allow vSphere Replication to create the number ot instances that you want to keep. El Eneäle guest as quiescing @ Enable network compression tor VR data (D CANCEL BACK NEXT

 

Final steps

  • Protection Group (PG)
  • Recovery Plan (RP)

 

Will create a new PG and RP

  • It would be wise to have a naming convention

Machine generated alternative text: Configure Replication Franky Rep Test 1 VM validation 2 Target site 3 Target datastore 4 Replication settings 5 Protection group 6 Recovery plan 7 Ready to complete Protection group You can add these virtual machines to a protection group. C) Add to existing protection group O Add to new protection group C) Do rot add to protection group now Protection group name: Franky PG

 

Create a Recovery Plan

Machine generated alternative text: Configure Replication Franky Rep Test 1 VM validation 2 Target site 3 Target datastore 4 Replication settings 5 Protection group 6 Recovery plan 7 Ready to complete Recovery plan You can optionally add this protection group to a recovery plan. C) Add to existing recovery plan O Add to new recovery plan C) Do rot add to recovery plan now Recovery plan name: Franky PG

 

Machine generated alternative text: Configure Replication Franky Rep Test 1 VM validation 2 Target site 3 Target datastore 4 Replication settings 5 Protection group 6 Recovery plan 7 Ready to complete Ready to complete Review your selected settings. Target site Replication server VM storage policy Target datastore Quiescing Network compression Recovery point objective Points in time recovery Instances for recovery Protection group Recovery plan uto-ass,ign Datastore Default DR Replication Target Disabled Disabled 20 hours Enabled Keep 1 instances per day tor the Est 7 days O Franky PG (new) Franky PG (new)

  • Source vC

Machine generated alternative text: Recent Tasks Task Name Protect VM Alarms Target Franky Rep Test Franky Rep Test Franky Rep Test Status Corn p',eted Corn p',eted Initiator Create Recovery Plan Create VM Protection Group Enable replication of virtual machine Configure a virtual m•chine for replication Queued For 26 ms 7 ms 16 ms

  • Target vC

Machine generated alternative text: Recent Tasks Task Nam disk Alarms VSPHERELOCALVSRM- VSPHERELOCALVSRM- VSPHERELOCALVSRM-

Screen will change to the VMware SRM Home screen

 

Next step is to Configure the Protection Group

 

  • Press View Details

Machine generated alternative text: Site Recovery NEW SITE PAIR Site Recovery Manager O Protection Groups 17 vSphere Replication —140 C] trom Menu v Cl Recovery Plans 16 VIEW DETAILS ACTIONS v Replications within the same vCenter Server within —J VIEW DETAILS

 

Search and click your PG on the left

Machine generated alternative text: Site Pair Protection Groups G Franky PG Replications C) Protection Groups Protection Groups + NEW C) Franky PG Recovery Plans Reccwery Status Ready Protection Type Individual VMS Protected Site Learn more Recovery Site Protection Status Not configured

 

We need to Configure Protection

  • BUT it’s greyed out
    • Note
      • I recreated this Protection Job 3 different ways and ended up with this same outcome

 

Machine generated alternative text: Site Pair Protection Groups Franky PG Replications O Protection Groups Q Franky PG Summary Issues Recovery Plans EDIT MOVE X DELETE permissions RESTORE ALL PLACEHOLDER VMS Virtual Machine La Franky Rep Test Recovery Plans Virtual Machines VMS Protection Status Mapping missing: Folder 'Franky's ESXi Lab' Recovery Resource Pool Recovery Host Recovery Folder Reccwery Network

 

I’m not one to back down from a challenge.

  • Idk the “official” fix…
    • When you click anywhere on the Virtual Machine line, the Configure Protection link is active
      • It’s just a matter of being faster than the computer….

 

Machine generated alternative text: RESTORE ALL PLACEHOLDER VMS Virtual Machine Franky Rep Test VMS OCONFIGURE PROTECTION Protection Status Mapping missing: Folder 'Franky's ESXi Lab'

 

Here is where we pick the folder at the Target site

  • Once vSphere Replication knows what VM Folder it should be using, it will create a Placeholder VM

Machine generated alternative text: Recreate Placeholder - Franky Rep Test VM Information VM Home Placeholder VM Home v Folder Protected Site Recovery Site Specify a folder for this VM at the recovery site Q) Resource Pool Protected Site Recovery Site use a different compute resource for this VM x anky Rep Test/Franky Rep Test_vmx not found Franky's ESXi Lab Override site mappings CANCEL

 

Task to create Placeholder VM

  • Source vC

Machine generated alternative text: Recent Tasks Task Name Alarms Restore Placeholder VM Target Franks' Rep Test Comp',eted

 

  • Target vC
    • Only shows that a disk was created
    • Should be able to see the VM
    • Managed by SRM

Machine generated alternative text: Recent Tasks Alarms Task Nam Comp'eæ± disk

 

Machine generated alternative text: Frank)" Rep Test ACTIONS v Summary Monitor Configure Guest as: Permissions Oatastores Networks Updates Compatibility: VMvvare Tools: Name: Addresses: VMware Photon OS (64-bit) ESXi SS and later (VM version 13) Not running. not installed Powered Oft Launch Web Console Launch Remote Console More info I e ecovery ils ensger

 

…and look at this..

We can now (Re)Configure Protection

Machine generated alternative text: Franky PG O Summary Issues EDIT MOVE X DELETE permissions Recovery Plans Virtual Machines RESTORE ALL VMS Virtual Machine Franky Rep Test & CONFIGURE ALL VMS O CONFIGURE PROTECTION Protection Status OK Reccwery Resource Pool

 

Machine generated alternative text: VM Protection Properties - Franky Rep Test VM Information ranky Rep Test/Franky Rep Testvmx VM Home Franky Rep Test_1/Franky Rep Test_vmx Placeholder VM Home v Folder Protected Site Recovery Site Q) Resource Pool g Hard diskl Replicated Device Type Hard Disk Device Status Replicated Source Datastores Franky Rep Test/Franky Rep Test.vmdk Source File , @ CD,'DVD drivel Client Device x

 

Now our Protection Group is Green and we’re all set

 

Let’s Test directly from our Protection Group

 

Machine generated alternative text: Site Pair Q Fra Protection Groups o Franky PG Replications C) Protection Groups O Franky PG Recovery Plans EDIT MOVE X DELETE Summary EDIT Issues MOVE permissions X DELETE Recovery Plans Virtual Machines CLEANUP @ RUN TEST Status Ready Protected Site Reccwery Site O Franky

 

Uncheck to Replicate recent changes

  • Depends on your test case

Press Next

Machine generated alternative text: Test - Frank)/ RP 1 Confirmation options 2 Ready to complete Confirmation options Test confirmation Running this plan in test mode will recover the virtual machines in a test environment on the recuery site. Protected site: Recovery site: Server connection: Number of VMs: Storage options Connected Specify whether to replicate recent changes to the recovery site. This process might take several minutes and is only available if the sites are connected. O Replicate recent changes to recovery site

 

Confirm

  • Press Finish

Machine generated alternative text: Test - Frank)/ RP 1 Confirmation options 2 Ready to complete Ready to complete Review your selected settings. Name Protected site Recovery site Server connection Number of VMS Storage synchronization Franky Connected Do rot replicate

 

Machine generated alternative text: C) Franky Test in progress

 

vSphere Tasks

  • Source vC

Machine generated alternative text: Recent Tasks Task Name Test Recuery Plan Alarms Target Status

 

  • Target vC

Machine generated alternative text: Recent Tasks Task Nam Test Rec Alarms VSPHERELOCALVSRM

 

  • VM gets powered on at Target vC

Machine generated alternative text: Franky Rep Test Summ ary Monitor Configure Guest as: ACTIONS v Permissions Oatastores VMware Photon OS (64-bit) Networks Updates Compatibility: VMvvare Tools: ESXi SS and later (VM version 13) Not running. not installed More info

 

Let’s take a look at the Recovery Steps in action.

 

  • Head over to the Recovery Plans tab
    • Find your RP
      • Recovery Steps

Machine generated alternative text: Site Pair Q Fra Recovery Plans Franky RP Replications O Protection Groups Recovery Plans Frank)/ MOVE X -EST Summary Recovery Steps Issues History permissions CLEANUP r. Protection Groups Virtual Machines Recovery Plan: Franky RP Protected Site: Recovery Site: Description:

 

Here you’ll find what exactly is being done during the failover

  • Notice the timeout
    • This is due to VMware Tools not being installed
    • I want to point out that the VM did complete the failover successfully and we can now continue with cloning our server at the Target site

Machine generated alternative text: Frank)/ MOVE X -EST CLEANUP r. Protection Groups Learn more Summary Recovery Steps EXPORT STEPS TEST Plan status: Description: Recovery Step > 1. Synchronize storage Issues History permissions Virtual Machines É CLEANUP CANCEL Test complete The virtual machines have been recovered in a test environment at the recovery site Review the plan history to view any errors or warnings. When you are ready to remove the test environment, run cleanup on this plan. Status Skipped Success Success Success O Timed out waiting tor VMware Tools after 300 seconds O Timed out waiting tar VMware Tools after 300 seconds Skipped Skipped Skipped Success O Timed out waiting tor VMware Tools after 300 seconds Step Started Test Steps Step Completed 2 Restore recovery site hosts trom standby 10 3 Suspend non-critical VMS at recovery site > 04 _ Create writable storage snapshot Configure test networks 6. on priority 1 VMS Power on priority 2 VMS Power on priority 3 VMS v 81. Franky Rep Test Guest startup Customize P Guest shutdown power on Wait for VMware tools g. Power on priority 4 VMS 10. Power on priority 5 VMS

 

Aftermath

  • We see that this VM is now attached to an ESXi Host
  • VM Tools warning
  • We can now Clone

Machine generated alternative text: Franky Rep Test Summ ary Monitor Configure Guest as: Permissions ACTIONS ActiUÆ - Rep Tæt Oatasto Power Compatibility: VMware Tools: Name: Addresses: Launch Web Connle Veneged By: Launch Remote Console VMwere Photon OS (6 Guest OS ESXi and later Not running. not installe Snapshots More info I e ecovery ils ansger Open Remote Console Migrate„ Clone Fault Tolerance VM Policies Template Compatibility to Virtual Mszlnina Clone to Template. Clone to Template in Library. There is no network assigned to this virtual machine VM'.•.'31e Toa's is not inst3LIee on this viltusL mschine

I like to be thorough, so I’ll walk you through modifying the Recovery Plan to skip the VM Tools validation.

First, let’s clean up our Test.

  • Recovery Plan
    • Select our RP
      • Cleanup

Machine generated alternative text: O Protection Groups Recovery Plans Frank)/ Summary Recovery Steps MOVE Issues History permissions É CLEANUP RUN Protection Groups Virtual Machines Recovery Plan: Franky RP Protected Site: Recovery Site: Descriptiom

Sometimes the cleanup will fail.

  • If (and when) it does, the “Force cleanup” button will be available
  • Press Next, then Finish

Machine generated alternative text: Cleanup - Franky RP 1 Confirmation options 2 Ready to complete Confirmation options Cleanup confirmation Running a cleanup operation on this plan will remove te test environment and reset the plan to the Ready state. Protected site: Recovery site: Server connection: Number of VMs: Cleanup options Connected If you are experiencing errors during cleanup, you can choose the Force Cleanup option to ignore all errors and return the plan to the Ready state. If you use this option, you might need to clean up your storage manually, and you should run another test as soon as possible ;arce cleanup

 

You’ll see this Task in the Source vC and the recovered VM will be powered off at the Target vC

Machine generated alternative text: Recent Tasks Task Name Cleanup Test Recovery Alarms Target Initiator Completed

Onto editing the Recovery Plan

  • Recovery Plan
    • Virtual Machines
      • Select your VM
        • Configure Recovery

Machine generated alternative text: otection Groups Recovery Plans C) Frank)/ RP "EDIT MOVE X DELETE TEST Summary Recovery Steps Issues History Permissions CLEANUP @ RUN Protection Groups O CONFIGURE RECOVERY PRIORITY GROUP Virtual Machine Franky Rep Test STARTUP ACTION v Recovery Status Ready for reccn.'ery Virtual Machines Status Modified By Franky Learn more Final Power State Protection Group Franky PG Priority 3 (Medium) Dependencies

 

Edit the Startup Action

  • Uncheck Wait for VMware tools
  • Press OK

Machine generated alternative text: VM Recovery Properties - Franky Rep Test Changes to these properties will apply to this VM in all recovery plans. x Recovery Properties P Customization Priority Group VM Dependencies vMotion Shutdown Action Timeout Startup Action VMware Tools Additional Delay Pre Power On Steps Post Power On Steps 3 (Medium) None Jiseäleci (VM is nat in storege policy protection group) Shutdown guest OS before power off (requires VMware Tools) minutes O seconds In Disaster Recovery mode. the VM will be powered off if Shutdown guest OS fails. Power on Wait tor VMware tools minutes C seconds Additional delay before running Post Power On steps and starting dependent VMS. minutes C None None seconds CANCEL

 

Test once more and should all be Green

 

Machine generated alternative text: O Protection Groups Recovery Plans C] Frank)/ RP "EDIT MOVE X DELETE TEST Summary Recovery Steps Issues History Permissions CLEANUP Protection Groups Virtual Machines EXPORT STEPS Plan status: Description: Recovery Step TEST CLEANUP @ RUN CANCEL Ready This plan is ready tor test or recovery > 1. Synchronize storage 2 Restore recovery site hosts trom standby 10 3 Suspend non-critical VMS at recovery site > 04 _ Create writable storage snapshot Configure test networks 6. on priority 1 VMS Power on priority 2 VMS Power on priority 3 VMS g. on priority 4 VMS 10. Power on priority 5 VMS

 

Machine generated alternative text: O Protection Groups Recovery Plans Frank)/ MOVE X -EST CLEANUP r. Protection Groups Summary Recovery Steps TEST EXPORT STEPS Plan status: Description: Recovery Step > 1. Synchronize storage Issues History permissions Virtual Machines É CLEANUP CANCEL Test complete 2 Restore recovery site hosts trom standby 10 3 Suspend non-critical VMS at recovery site > 04 _ Create writable storage snapshot Configure test networks 6. on priority 1 VMS Power on priority 2 VMS Power on priority 3 VMS g. on priority 4 VMS 10. Power on priority 5 VMS The virtual machines have been recovered in a test environment Status Skipped Success Success Success Success

 

Findings

  • I protected the VM 2 different ways and always ended up with a greyed out Configuration Replication button

 

Thanks for reading and I hope my scratch notes were able to help someone. Until next time. Adios!

Leave a Reply

Your email address will not be published. Required fields are marked *