6.7. Cloning Desktops

6.7.1. How to Clone Desktops (Oracle VDI Hypervisor)
6.7.2. How to Clone Desktops (VMware vCenter)
6.7.3. How to Enable VMware Linked Cloning
6.7.4. How to Clone Desktops (Microsoft Hyper-V)
6.7.5. About Clone Customization
6.7.6. How to Debug Fast Preparation Problems
6.7.7. How to Enable Oracle VDI Fast Preparation for Windows Templates (Oracle VDI Hypervisor and Microsoft Hyper-V)
6.7.8. How to Enable System Preparation for Windows Templates (Oracle VDI Hypervisor and Microsoft Hyper-V)
6.7.9. About Personal Hard Drives
6.7.10. Clone and Recycle Job Management

6.7.1. How to Clone Desktops (Oracle VDI Hypervisor)

Cloning is the fastest and most efficient way to populate a pool. Use the steps below to enable cloning in a pool.

Before You Begin

A desktop must be imported before a template can be cloned. Refer to the Section 6.6.1, “How to Import Desktops (Oracle VDI Hypervisor)” section for detailed information.

Oracle VDI Manager Steps

  • To enable cloning in an existing pool:

    1. In Oracle VDI Manager, go to Pools.

    2. Select a pool.

    3. Go to the Cloning tab.

    4. Select a template from the Template menu. For Oracle VDI and Microsoft Hyper-V desktop providers, all desktops will be cloned from the master revision of the selected template.

    5. To start cloning, check Enable Automatic Cloning and click Save.

  • To enable cloning in the New Pool wizard during pool creation:

    1. Choose the desktop template and select Enable Automatic Cloning.

    2. Click Finish to finalize the pool creation, and begin the automatic cloning.

Cloning can take up to a minute to start, after which you will see clone jobs begin to display in the Jobs window. To access the Jobs window, click the Jobs Running link in the top left of Oracle VDI Manager. After a clone job has been finished successfully, the new desktop will be displayed in the Desktops tab of the pool's profile. A page refresh might be necessary.

CLI Steps

  • Start automatic cloning in a pool.

    # /opt/SUNWvda/sbin/vda pool-start pool name
    

    Example - Starting automatic cloning in a pool

    example% /opt/SUNWvda/sbin/vda pool-start MyPool

6.7.2. How to Clone Desktops (VMware vCenter)

Cloning is the fastest and most efficient way to populate a pool. Use the steps below to enable cloning in a pool.

Oracle VDI includes support for VMware linked clones. For details of how to enable the use of linked clones in Oracle VDI, see Section 6.7.3, “How to Enable VMware Linked Cloning”.

Before You Begin

A virtual machine must be imported before a template can be cloned. Refer to the Section 6.6.2, “How to Import Desktops (VMware vCenter)” section for detailed information.

Oracle VDI Manager Steps

  1. In Oracle VDI Manager, go to Pools.

  2. Go to the Resources tab.

  3. Select your preferred storage for newly cloned virtual machines.

    By default, all available storage may be used. For each clone, Oracle VDI will select the storage with the most available disk space.

  4. Go to the Cloning tab.

  5. Select the preferred template from the Template menu.

    The menu will list all templates that are available in the VMware vCenter.

  6. Select Apply System Preparation, and specify which Customization Specification should be used.

  7. Select Enable Automatic Cloning, and click Save to begin cloning.

Cloning can take up to a minute to start, after which you will see clone jobs begin to display in the Jobs window. To access the Jobs window, click the Jobs Running link in the top left of Oracle VDI Manager. After a clone job has been finished successfully, the new desktop will display in the Desktops tab of the pool's profile. A page refresh might be necessary.

CLI Steps

  • Start automatic cloning in a pool.

    # /opt/SUNWvda/sbin/vda pool-start pool name
    

6.7.3. How to Enable VMware Linked Cloning

Oracle VDI includes support for VMware linked clones. VMware linked cloning enables multiple virtual machines to share virtual disks with a parent virtual machine and use the same software installation. Linked clones conserve disk space by storing the differences for each virtual machine in delta disks. Linked clones are also created more quickly than full clones. Detailed information on VMware linked cloning is available on the VMware web site.

VMware linked cloning is applied on a per pool basis.

Before You Begin

VMware linked cloning is available for use only if the following conditions are met:

  • VMware ESX 4.0 or later must be used.

  • A template must have at least one snapshot.

Oracle VDI Manager Steps

  1. In Oracle VDI Manager, go to Pools.

  2. Select a pool.

  3. Go to the Cloning tab.

  4. Select the Linked Cloning check box.

  5. Click Save.

CLI Steps

  • Enable linked cloning for a pool.

    # /opt/SUNWvda/sbin/vda pool-setprops -p linked-cloning=enable pool name
    

    In the following example, linked cloning is enabled for a pool named MyPool.

    # /opt/SUNWvda/sbin/vda pool-setprops -p linked-cloning=enabled MyPool

    In the following example, linked cloning is disabled for a pool named MyPool

    # /opt/SUNWvda/sbin/vda pool-setprops -p linked-cloning=disabled MyPool

6.7.4. How to Clone Desktops (Microsoft Hyper-V)

Cloning is the fastest and most efficient way to populate a pool. Use the steps below to enable cloning in a pool.

Before You Begin

A virtual machine must be imported before a template can be cloned. Refer to the Section 6.6.3, “How to Import Desktops (Microsoft Hyper-V)” section for detailed information.

Oracle VDI Manager Steps

  • To enable cloning in an existing pool:

    1. In Oracle VDI Manager, go to Pools.

    2. Select a pool.

    3. Select the Cloning tab, and specify the cloning parameters.

    4. At a minimum, define a desktop template to clone from, and select Enable Automatic Cloning.

  • To enable cloning in the New Pool wizard during pool creation:

    1. Choose the desktop template and select Enable Automatic Cloning.

    2. Click Finish to finalize the pool creation, and begin the automatic cloning.

Cloning can take up to a minute to start, after which you will see clone jobs beginning to display in the Jobs window. To access the Jobs window, click the Jobs Running link in the top left of Oracle VDI Manager. After a clone job has been finished successfully, the new desktop will display in the Desktops tab of the Pool page. A page refresh might be necessary.

CLI Steps

  • Start automatic cloning in a pool.

    # /opt/SUNWvda/sbin/vda pool-start pool name
    

    In the following example, automatic cloning is enabled for the pool MyPool.

    # /opt/SUNWvda/sbin/vda pool-start MyPool

6.7.5. About Clone Customization

Oracle VDI offers two methods for customizing Windows desktops during the cloning process, Microsoft System Preparation (Sysprep), which is often used in Active Directory environments, and Oracle VDI Fast Preparation (FastPrep). Oracle VDI FastPrep is a replacement for Microsoft Sysprep. You can trigger Sysprep from within Oracle VDI Manager.

Sysprep ensures that each desktop clone is assigned its own unique security identifier (SID). The corresponding template revision is automatically marked as Sysprepped once the preparation has completed.

FastPrep is designed to reduce the clone time of each desktop. It leverages Sysprep and changes the computer name of each clone, joins it to a domain, and, optionally, can execute a post-customization script.

6.7.6. How to Debug Fast Preparation Problems

In the event that cloning fails with Fastprep, error codes are often returned. Typically, they are Microsoft Windows System Error Codes returned by the desktop or domain controller when a clone attempts to join the domain. The error codes are described in:

http://msdn.microsoft.com/en-us/library/ms681381%28v=vs.85%29.aspx

If further debugging is needed, you can disable the automatic cleanup of failed clones by running the following command:

# /opt/SUNWvda/sbin/vda settings-setprops -p cloning.cleanup.failures=disabled

With this setting disabled, Oracle VDI does not delete any failed clones, and you can examine a clone to find out why an error occurred.

If issues persist when trying to join a domain, inspect the Windows netsetup.log on the clone in C:\Windows\Debug\netsetup.log for debug output of the attempted join operation.

Once the issue is resolved, enable the automatic cleanup of failed clones by running the following command:

# /opt/SUNWvda/sbin/vda settings-setprops -p cloning.cleanup.failures=enabled

Failed clones that occur while automatic cleanup is disabled remain on the provider host. You must manually delete these clones using Oracle VDI Manager or the command line.

6.7.7. How to Enable Oracle VDI Fast Preparation for Windows Templates (Oracle VDI Hypervisor and Microsoft Hyper-V)

Windows desktops require customization for successful cloning by Oracle VDI. Unlike Microsoft System Preparation, Fast Preparation (FastPrep) does not require any special preparation of the template prior to use.

Before You Begin

  1. Prepare the template for Fast Preparation.

    1. If a post-customization script is required, the script should be copied to the template prior to cloning.

    2. Ensure that the template is not a member of a domain, it must be a member of a workgroup.

  2. Import a virtual machine template in Oracle VDI Manager.

    For more information, see the following:

Oracle VDI Manager Steps

  1. In Oracle VDI Manager, go to Pools.

  2. Select a pool.

  3. Go to the Cloning tab (or the Select Template screen of the New Pool wizard).

  4. Click Create next to System Preparation.

  5. Select the appropriate Fast Preparation option from the drop down for your template OS.

  6. The Create System Preparation File dialog will appear.

    • Windows Domain - The FQDN of the Windows domain. e.g. my.domain.com

    • Domain Administrator - A domain administrator with permission to create a computer account and join the domain. This can optionally be prefixed with the domain, e.g. my.domain.com\Administrator

    • Domain Administrator Password - The password the for the domain administrator

    • Computer Container DN - The DN to place the new computer account in (e.g. OU=Accounting,OU=VDI Center,DC=my,DC=domain,DC=com). If left blank the default Computers container is used (ou=Computers,DC=my,DC=domain,DC=com).

    • Read-only Domain Controller - From Windows 2008 Server, domain controllers (DC) can be configured as read-only for deployments in unsecured locations. For a computer to join a domain via a read-only DC the account must already exist and a special read-only flag is needed.

    • Desktop Administrator - An administrator account on the template that has permissions to change the computer name, join a domain and optionally execute the custom script. For Windows Vista/7 the 'Administrator' account must be enabled and used.

    • Desktop Administrator Password - The desktop administrator password

    • Custom Script - An optional script that will be executed after customization has completed. This script can be a batch file or executable and must be located in a drive or folder accessible by the template and clones.

You are now ready to clone customized Windows desktops. Refer to the Section 6.7.1, “How to Clone Desktops (Oracle VDI Hypervisor)” and Section 6.7.4, “How to Clone Desktops (Microsoft Hyper-V)” sections.

CLI Steps

  • Prepare a pool for sysprepped cloning.

    # /opt/SUNWvda/sbin/vda pool-create-fastprep -p domain=<domain>,\
    domain-admin=<domain-admin>,admin=<admin>,\
    windows-release=winxp|win7 -u <user-dir><pool-name>
    

6.7.8. How to Enable System Preparation for Windows Templates (Oracle VDI Hypervisor and Microsoft Hyper-V)

Windows desktops require System Preparation for successful cloning by Oracle VDI. After you create a Windows virtual machine, you should prepare it for Sysprep by downloading a Sysprep CAB (Windows XP only), and installing the Oracle VDI Tools (Hyper-V virtualization platforms only). Import the virtual machine into Oracle VDI as a template, and select System Preparation on one of the template revisions. Oracle VDI boots the revision, runs Sysprep.exe, and then shuts down the system. The revision now acts as a blank slate for cloning desktops in any pool with a valid System Preparation file.

A pool's System Preparation file defines licensing and credentials. If a pool has a valid System Preparation file, System Preparation is enabled, and cloning from the sysprepped template is enabled, all cloned desktops in the pool will have the customization defined by the System Preparation file.

One sysprepped revision can be used for multiple pools, and the System Preparation files can be changed and saved at any time from within Oracle VDI Manager.

Note

Due to a bug in Windows 7, the Windows Media Player Network Sharing Service causes the Windows Sysprep tool to hang. If you do not need this service enabled in your Windows 7 desktops and you intend to run System Preparation from Oracle VDI Manager, stop and disable it. If you prefer to leave this service enabled, run Sysprep manually from within the template's Run console before importing it.

sysprep.exe -generalize -oobe -shutdown -quiet

Before You Begin

  1. (Hyper-V Only) Install the Oracle VDI Tools on the template.

    The System Preparation action in the Template tab will not work if you do not have the tools (vda-tools-x86.msi for 32-bit platforms or vda-tools-x64.msi for 64-bit platforms) installed on your template. For Windows XP templates, you also need to have the Sysprep tools in a C:\Sysprep directory.

  2. Prepare the template for System Preparation.

  3. Import a virtual machine template in Oracle VDI Manager.

    For more information, see the following:

Oracle VDI Manager Steps

  1. In Oracle VDI Manager, go to Pools.

  2. Select a pool.

  3. Run System Preparation in a template revision.

    1. Go to the Template tab, and select a revision.

    2. Choose System Preparation from the More Actions menu.

      This action will start a job, start the revision, run Sysprep.exe, and wait for the system to shut down.

    3. Wait for the job to complete successfully via the Job Summary pop-up. If the job fails for any reason, details of the failure can viewed in the Job Details text area by clicking on the failed job.

    4. Select the sysprepped revision and click Make Master.

      All pools currently using this template will clone new desktops from the sysprepped revision.

  4. Prepare a pool to clone customized desktops based on a System Preparation file.

    1. Go to the Cloning tab (or the Select Template screen of the New Pool wizard).

    2. Create a System Preparation file.

      The file requires a Windows administrator password, a Windows license key, and a Windows workgroup or a Windows domain, domain administrator, and administrator password.

    3. Select the sysprepped template, and select Apply System Preparation.

      You are now ready to clone customized Windows desktops. Refer to the Section 6.7.1, “How to Clone Desktops (Oracle VDI Hypervisor)” and Section 6.7.4, “How to Clone Desktops (Microsoft Hyper-V)” sections.

CLI Steps

  1. Run System Preparation in a template revision.

    1. Choose a template from the pool (template ID).

      # /opt/SUNWvda/sbin/vda pool-templates pool name
      
    2. Choose a revision from the template (revision ID).

      # /opt/SUNWvda/sbin/vda template-revisions template ID
      
    3. Apply Sysprep to the revision.

      # /opt/SUNWvda/sbin/vda revision-sysprep revision ID
      
  2. Prepare a pool for sysprepped cloning.

    To create a System Preparation file for a pool.

    # /opt/SUNWvda/sbin/vda pool-create-sysprep -p \
    key=<key>,workgroup=<workgroup>,windows-arch=32|64,\
    windows-release=winxp|win7 <pool-name>
    

    To apply an existing System Preparation file to new or existing pools.

    # /opt/SUNWvda/sbin/vda pool-create -p system-preparation=path to filepool name
    
    # /opt/SUNWvda/sbin/vda pool-setprops -p system-preparation=path to filepool name
    

    Example - Enabling System Preparation for a pool of Oracle VM VirtualBox desktops.

    example% /opt/SUNWvda/sbin/vda pool-templates MyPool
    example% /opt/SUNWvda/sbin/vda template-revisions 35
    example% /opt/SUNWvda/sbin/vda revision-sysprep 55
    example% /opt/SUNWvda/sbin/vda pool-create-sysprep -p \
    key=ABC12-DEF34-GHI56-JKL78-MNO90,domain=mydomain.mycompany.com,\
    domain-admin=Administrator,windows-arch=64,windows-release=win7 MyPool

6.7.9. About Personal Hard Drives

Oracle VDI includes many features to simplify the provisioning of user desktops. This includes automatic cloning and recycling of old desktops, flexible and personal assignments, and now includes in-line template management (revisions). Using these features, an administrator can destroy a user's old desktop and clones a fresh one in its place. While this process is straight-forward and saves time, it has one serious deficiency - the user's local data is destroyed each time the desktop is updated from a newer revision.

Enabling the Personal Hard Drive feature provisions a second data disk to each desktop, a drive 'D:'. The user's profile directory, including all information stored under C:\Documents and Settings\UserName, is redirected to this second 'personal hard drive'. When an administrator updates the desktop revision or template, the desktop's primary disk, containing the OS, is replaced with a clone of the new revision. During this process, the users personal hard drive is preserved and re-attached to the new clone leaving all profile settings and personal data intact. Personal hard drives should be used when users have personal information stored on their desktop which should be persistent throughout template/revision updates.

Personal hard drives can only be used on desktops in personal pools with an Active Directory connection (LDAP, Kerberos, or Public Key) using either Sysprep or FastPrep. To enable the Personal Hard Drive feature, go to the Cloning tab of a pool's profile in Oracle VDI Manager. A pop-up window will allow you to enable the feature and set the size of the personal hard disk. Only desktops cloned after the feature has been enabled will have the second disk. Existing desktops will not be affected. Updating the master revision of a template used by a personal pool will result in all available desktops being recycled and replaced with the new clones. Any assigned and idle desktops will be refreshed with the new revision but retain the assignment and personal hard drive.

6.7.10. Clone and Recycle Job Management

The cloning and recycling of desktops can be a resource intensive processes. For this reason, Oracle VDI enables you to limit the number of clone and recycle jobs that can run in your Oracle VDI environment at any one time.

6.7.10.1. Setting Cloning Production Priorities for Pools

At the pool level, Oracle VDI Manager enables you to specify the cloning production priority for particular pools. This priority is assigned to the pool when clone jobs are being submitted. A pool with a high production priority is allowed to clone more quickly than a pool with medium priority, and a pool with medium priority is allowed to clone more quickly than a pool with low priority. The production priority setting does not apply to recycle jobs.

To set the cloning production priority for pools, select an existing pool in the Pool category and click on the Cloning tab.

6.7.10.2. Setting Peak Times for Desktop Providers

At the desktop provider level, Oracle VDI Manager enables you to specify the maximum number of cloning and recycling jobs that will run at peak and off-peak times. You can also configure the times during each day that are considered peak times. Once set, Oracle VDI will control the combined total number of clone and recycle jobs that it runs according to the limits that are set.

To set the peak times information, select a desktop provider's profile in the Desktop Providers category and click on the Peak Times tab.