5.7. Cloning Desktops

5.7.1. How to Clone Desktops (Oracle VM VirtualBox)
5.7.2. How to Clone Desktops (VMware vCenter)
5.7.3. How to Enable VMware Linked Cloning
5.7.4. How to Clone Desktops (Microsoft Hyper-V)
5.7.5. About Clone Customization
5.7.6. How to Debug Fast Preparation Problems
5.7.7. How to Enable Oracle VDI Fast Preparation for Windows Templates (Oracle VM VirtualBox and Microsoft Hyper-V)
5.7.8. How to Enable System Preparation for Windows Templates (Oracle VM VirtualBox and Microsoft Hyper-V)
5.7.9. About Personal Hard Drives
5.7.10. Clone and Recycle Job Management

5.7.1. How to Clone Desktops (Oracle VM VirtualBox)

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 5.6.1, “How to Import Desktops (Oracle VM VirtualBox)” section for detailed information.

Oracle VDI Manager Steps

To enable cloning for an existing pool:

  1. In Oracle VDI Manager, go to Pools.

  2. Select a pool.

  3. Go to the Cloning tab.

  4. Select Enable Automatic Cloning.

  5. In the Name Pattern field, enter the naming pattern to use for the cloned desktops.

    The name pattern is used to generate the name for the virtual machine and, for Windows desktops that use either Sysprep or FastPrep, the name of the computer that is registered in the Windows domain.

    The naming pattern consists of a prefix (the default prefix is the name of the pool) followed by a sequence of "0" characters which are placeholders for the sequential number of the cloned desktops. Ensure that you configure enough "0" character placeholders for the expected number of desktops in the pool, for example enter "000" if the pool contains up to 999 desktops. If the desktops will join a Windows domain, the naming pattern must only contain numbers (0-9), letters (A-Z) and hyphens (-) and must not exceed 15 characters in length.

  6. From the Template list, select a template.

    Desktops are cloned from the master revision of the selected template.

  7. Click Save.

To enable cloning when you create a pool:

  1. In the New Pool wizard, on the Select Template step, from the Template list, select a template.

  2. On the Select Pool Size step, select Enable Automatic Cloning.

  3. On the Review step, click Finish.

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

5.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 5.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 5.6.2, “How to Import Desktops (VMware vCenter)” section for detailed information.

Oracle VDI Manager Steps

To enable cloning for an existing pool:

  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 selects the storage with the most available disk space.

  4. Go to the Cloning tab.

  5. Select Enable Automatic Cloning.

  6. In the Name Pattern field, enter the naming pattern to use for the cloned desktops.

    The name pattern is used to generate the name for the virtual machine and, for Windows desktops that use either Sysprep or FastPrep, the name of the computer that is registered in the Windows domain.

    The naming pattern consists of a prefix (the default prefix is the name of the pool) followed by a sequence of "0" characters which are placeholders for the sequential number of the cloned desktops. Ensure that you configure enough "0" character placeholders for the expected number of desktops in the pool, for example enter "000" if the pool contains up to 999 desktops. If the desktops will join a Windows domain, the naming pattern must only contain numbers (0-9), letters (A-Z) and hyphens (-) and must not exceed 15 characters in length.

  7. From the Template list, select a template.

    Desktops are cloned from the master revision of the selected template.

  8. Select Apply System Preparation and select a customization specification from the list.

  9. Click Save.

To enable cloning when you create a pool:

  1. In the New Pool wizard on the Select Template step, from the Template list, select a template.

  2. On the Select Pool Size step, select Enable Automatic Cloning.

  3. On the Review step, click Finish.

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
    

5.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

5.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 5.6.3, “How to Import Desktops (Microsoft Hyper-V)” section for detailed information.

Oracle VDI Manager Steps

To enable cloning for an existing pool:

  1. In Oracle VDI Manager, go to Pools.

  2. Select a pool.

  3. Go to the Cloning tab.

  4. From the Template list, select a template.

    Desktops are cloned from the master revision of the selected template.

  5. In the Name Pattern field, enter the naming pattern to use for the cloned desktops.

    The name pattern is used to generate the name for the virtual machine and, for Windows desktops that use either Sysprep or FastPrep, the name of the computer that is registered in the Windows domain.

    The naming pattern consists of a prefix (the default prefix is the name of the pool) followed by a sequence of "0" characters which are placeholders for the sequential number of the cloned desktops. Ensure that you configure enough "0" character placeholders for the expected number of desktops in the pool, for example enter "000" if the pool contains up to 999 desktops. If the desktops will join a Windows domain, the naming pattern must only contain numbers (0-9), letters (A-Z) and hyphens (-) and must not exceed 15 characters in length.

  6. To start cloning, select Enable Automatic Cloning.

  7. Click Save.

To enable cloning when you create a pool:

  1. In the New Pool wizard, on the Select Template step, from the Template list, select a template.

  2. On the Select Pools Size step, select Enable Automatic Cloning.

  3. Click Finish.

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

5.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.

5.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.

5.7.7. How to Enable Oracle VDI Fast Preparation for Windows Templates (Oracle VM VirtualBox 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 5.7.1, “How to Clone Desktops (Oracle VM VirtualBox)” and Section 5.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>
    

5.7.8. How to Enable System Preparation for Windows Templates (Oracle VM VirtualBox 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 5.7.1, “How to Clone Desktops (Oracle VM VirtualBox)” and Section 5.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

5.7.9. About Personal Hard Drives

Each time a user's desktop is updated to a new template revision, their local data is destroyed. One solution to this problem is to use personal hard drives. When personal hard drives are enabled, Oracle VDI automatically creates a second data disk for each desktop, a drive D:. The Windows user profile directory is stored on this drive and contains all the information normally stored in one of the following locations:

  • C:\Documents and Settings\<username> (Windows XP platforms)

  • C:\Users\<username> (Windows Vista and later platforms)

Whenever the desktop template is updated (a new revision), the desktop's primary disk containing the operating system is replaced with a fresh clone. The user's personal hard drive is preserved and reattached to the fresh clone.

Only use personal hard drives when users have a requirement to store personal information in their desktop and that information must be retained after template and revision updates.

To use personal hard drives the following must be true:

  • The user directory for the company must be Active Directory. The user directory can be configured as either an LDAP directory type or as Active Directory type.

  • The desktop provider type must be either Oracle VM VirtualBox or Microsoft Hyper-V.

  • The assignment type for desktops in the pool must be personal.

  • System preparation must be enabled for the pool. You can use either Oracle VDI Fast Preparation (FastPrep) or Microsoft Windows System Preparation (SysPrep).

  • The desktop must be a Windows desktop.

5.7.9.1. Enabling Personal Hard Drives

Personal hard drives are only added to desktops that are cloned after the personal hard drive feature is enabled. Existing personal desktops are not affected.

Oracle VDI Manager Steps
  1. In Oracle VDI Manager, go to Pools and select a pool.

  2. Go to the Cloning tab.

  3. Click Edit Personal Hard Drive Settings.

    The Edit Personal Hard Drive Settings Windows is displayed.

  4. Select Create Personal Hard Disk.

  5. In the Size field, enter the size of the personal hard drive in gigabytes.

    The size must be a whole number without a decimal point.

  6. Click OK.

  7. On the Cloning tab, check that the Personal Hard Drive setting shows Enabled.

Command Line

On the command line, you enable personal hard drives by editing the properties of the pool. You can do this when you create the pool, or by editing the pool, as follows:

/opt/SUNWvda/sbin/vda pool-setprops \
-p personal-hd-enabled=enabled,personal-hd-size=6 <pool name>

5.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.

5.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.

5.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 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 peak times in Oracle VDI Manager, go to the Peak Times tab for the desktop provider. On the command line, use the vda provider-setpeaktimes command.