For replications to cloud sites backed by VMware Cloud Director, specify the destination network settings, the guest customization, and the script that apply when recovering the workload in the destination site.

When replicating to a cloud site backed by VMware Cloud Director, before recovering the workload in the destination site, you can configure the destination network, the operating system guest customizations, and a shell script that executes after recovery.
Note: This procedure applies only for replications with cloud sites backed by VMware Cloud Director.

For vSphere DR and migration between vCenter Server sites, see Configure recovery settings for vSphere DR and migration.

Prerequisites

  • Prerequisites for guest customization:
    • Guest customization requires the virtual machine to be running VMware Tools.
    • To customize a Windows guest operating system, the system administrator must install the appropriate Microsoft Sysprep files on the VMware Cloud Director server group. For more information, see the VMware Cloud Director Installation, Configuration, and Upgrade Guide.
    • To customize a Linux guest operating system, Perl must be installed in the guest.
  • Verify that VMware Cloud Director Availability 4.5 or later is deployed in both the source and in the destination sites.
  • Verify that you can access VMware Cloud Director Availability as a tenant or as a service provider. For more information, see Accessing VMware Cloud Director Availability.

Procedure

  1. In the left pane, choose a replication direction by clicking Incoming Replications or Outgoing Replications.
  2. To modify virtual machine replications, in the top of the page click the VM tab, or to modify vApp replications, stay on the vApp tab.
  3. Select one or more replications.
  4. Click All Actions > Recovery Settings.
  5. In the Recovery settings window, to modify the settings for the guest OS in the destination site, click Guest customization.
    • For migration and failover settings, click the Migrate/failover tab.
    • Alternatively, for test failover settings, click the Test tab.
    For information about Networks and Nics, see Configuring network settings of replications to the cloud.
    1. On the Guest Customization page, expand the virtual machine name.
      • When the source is a cloud site, by default, the Use source settings toggle is activated and the source virtual machine settings apply after the settings from the source replicate. The Use source settings toggle is deactivated when no settings come from the source. To allow guest customization, keep the Use source settings toggle deactivated.
        Note: For information about deactivating Use source settings globally and allowing replicating the VMware Cloud Director guest customization settings, see Replicate source VM guest customization settings. When this replication is deactivated globally, instead of Use source settings you can click Apply source settings for each replication.
      • When the source is an on-premises site, no source settings exist and the toggle does not show.
    2. On the Guest Customization page, configure the General section for the expanded virtual machine.
      The default settings in the following three tables apply for source workloads that do not already use guest customization or when the source is an on-premises site. If the source is a cloud site and the workload already uses guest customization, by enabling the Use source settings toggle, the settings reflect the already customized source workload.
      Option Description
      Guest customization Deactivated by default. To apply any guest customizations, activate this toggle.

      When the virtual machine uses Guest Properties for customization do not activate the Guest customization toggle.

      Computer name Change the computer name of the destination virtual machine.
      Note: With active Guest customization toggle, if you skip entering the computer name, VMware Cloud Director automatically generates one, for example vmname-001 then virtual machines running a Windows guest operating system may disjoin from the domain.
      The computer name and network settings apply to the guest operating system when the virtual machine is powered on.
      Change SID To change the Security ID (SID) for uniquely identifying systems and users, activate this toggle.

      The SID applies only for virtual machines running a Windows guest operating system. VMware Cloud Director runs sysprep to change the Windows SID. On Windows NT, VMware Cloud Director uses sidgen. Running sysprep is a prerequisite for completing domain join.

      By not activating this toggle, the destination virtual machine has the same SID as the source virtual machine.

      Change SID only applies the first time the virtual machine powers on, or if in VMware Cloud Director you perform Power on and Force Recustomization.

    3. Expand the Password Reset section.
      Password reset only applies the first time the virtual machine powers on, or if in VMware Cloud Director you perform Power on and Force Recustomization.
      Option Description
      Allow local administrator password Activate this toggle to allow setting an administrator password on the guest operating system.
      Require Administrators to change password on first login Activate this toggle to require administrators to change the password of the guest operating system on the first login.
      Auto generate password

      Activate this toggle to allow password auto generation.

      Specify password To enter a password, activate the Allow local administrator password toggle and deactivate the Auto generate password toggle.
      Number of times to log on automatically

      Required for automatically generated passwords, or else the user is not able to log in.

      Enter 0 to disable the automatic log on as an Administrator user.
    4. Expand the Join Domain section.
      This section only applies for virtual machines running a Windows guest operating system. Join domain only applies the first time the virtual machine powers on, or if in VMware Cloud Director you perform Power on and Force Recustomization.
      Option Description
      Join domain Activate this toggle to join the virtual machine to a Windows domain, then enter the following domain properties.
      Use organization's domain Activate this toggle to use the domain of the organization. Alternatively, override the organization's domain by entering the domain properties.
      Domain name Enter the Windows domain name.
      Domain username Enter the name of the domain user account.
      Domain password Enter the password of the domain user account.
      Account organizational unit Enter the account organizational unit.
    5. Expand the Script section then in the Script content text box, enter the contents of the script that executes in the recovered virtual machine.
      The script only applies the first time the virtual machine powers on, or if in VMware Cloud Director you perform Power on and Force Recustomization.

      When entering a customization script in a virtual machine, the script:

      • Cannot contain more than 1500 characters.
      • Needs to be a batch file for Windows virtual machines and a shell script for Unix virtual machines.
      • The precustomization command line parameter calls the script before guest customization begins.
      • The postcustomization command line parameter calls the script after guest customization finishes.
      Example scripts:
      • Virtual Machine Guest Operating System Example script
        Windows sample batch file
        @echo off
        if "%1%" == "precustomization" (
        echo Do precustomization tasks
        ) else if "%1%" == "postcustomization" (
        echo Do postcustomization tasks
        )
        A Linux sample shell script
        #!/bin/sh
        if [ x$1 == x"precustomization" ]; then
        echo Do Precustomization tasks
        elif [ x$1 == x"postcustomization" ]; then
        echo Do Postcustomization tasks
        fi
      • The following script contents output a text string, followed by the date in a text file placed in the root of the filesystem of the virtual machine in the destination site:
        echo 'Test string' "$(date)" > /file.txt
      • The following example deliberately fails the script execution. The replication task succeeds with a green check, but shows a warning: Unable to apply Guest Customization for recovery virtual machine 'vm-name'.
        exit 1
  6. Click Apply.

Results

In the Tasks pane, a replication task runs. In case the prerequisites for guest customization are not met, the workload is recovered without customizations and the replication task succeeds with a green check but shows a warning: Unable to apply Guest Customization for recovery virtual machine 'vm-name'. Guest Customization couldn't complete in 300000 ms for recovery virtual machine 'vm-name'.