5.5. Cloning Desktops

5.5.1. Cloning Desktops (Oracle VM VirtualBox)
5.5.2. Cloning Desktops (VMware vCenter)
5.5.3. Enabling VMware Linked Cloning
5.5.4. Cloning Desktops (Microsoft Hyper-V)
5.5.5. About Clone Customization
5.5.6. Debugging Fast Preparation Problems
5.5.7. Enabling Oracle VDI Fast Preparation for Windows Templates (Oracle VM VirtualBox and Microsoft Hyper-V)
5.5.8. Enabling System Preparation for Windows Templates (Oracle VM VirtualBox and Microsoft Hyper-V)
5.5.9. About Personal Hard Drives and Windows User Profiles
5.5.10. Clone and Recycle Job Management

5.5.1. Cloning 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.

A desktop must be imported before a template can be cloned. Refer to the Section 5.4.1, “Importing Desktops (Oracle VM VirtualBox)” section for detailed information.

Oracle VDI Manager Steps (Existing Pool)

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

  2. Click the Cloning tab and select Enable Automatic Cloning.

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

  4. From the Template list, select a template.

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

  5. Click Save.

Oracle VDI Manager Steps (Pool Creation)

  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 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 is displayed in the Desktops tab of the pool's profile. A page refresh might be necessary.

Command Line Steps

  • Start automatic cloning in a pool.

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

    Example - Starting automatic cloning in a pool

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

5.5.2. Cloning 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.5.3, “Enabling VMware Linked Cloning”.

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

Oracle VDI Manager Steps (Existing Pool)

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

  2. Click 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.

Oracle VDI Manager Steps (Pool Creation)

  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 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 is displayed in the Desktops tab of the pool's profile. A page refresh might be necessary.

Command Line Steps

  • Start automatic cloning in a pool.

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

5.5.3. Enabling 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 configured for each pool.

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.

Command Line 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.5.4. Cloning 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.

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

Oracle VDI Manager Steps (Existing Pool)

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

  2. Click the Cloning tab.

  3. From the Template list, select a template.

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

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

  5. To start cloning, select Enable Automatic Cloning.

  6. Click Save.

Oracle VDI Manager Steps (Pool Creation)

  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 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 is displayed in the Desktops tab of the Pool page. A page refresh might be necessary.

Command Line 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.5.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.5.6. Debugging 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 C:\Windows\Debug\netsetup.log on the clone 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.5.7. Enabling 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, copy the script to the template before 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, select Pools and select a pool.

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

  3. Click Create next to System Preparation.

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

  5. The Create System Preparation File dialog is displayed.

    • Windows Domain - The FQDN of the Windows domain, for example example.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, for example example.com\Administrator

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

    • Computer Container DN - The DN to place the new computer account in for example OU=Accounting,OU=VDI Center,DC=example,DC=com. If left blank the default Computers container, ou=Computers, is used.

    • 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 7 and later, 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.5.1, “Cloning Desktops (Oracle VM VirtualBox)” and Section 5.5.4, “Cloning Desktops (Microsoft Hyper-V)” sections.

Command Line 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-dirpool-name
    

5.5.8. Enabling 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 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.

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 (Hyper-V Only)

  1. 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, select Pools and select a pool.

  2. 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 starts a job, starts the revision, runs Sysprep.exe, and then waits 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 clone new desktops from the sysprepped revision.

  3. 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.5.1, “Cloning Desktops (Oracle VM VirtualBox)” and Section 5.5.4, “Cloning Desktops (Microsoft Hyper-V)” sections.

Command Line 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 pool-name
    
    /opt/SUNWvda/sbin/vda pool-setprops -p system-preparation=path pool-name
    

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

    /opt/SUNWvda/sbin/vda pool-templates MyPool
    
    /opt/SUNWvda/sbin/vda template-revisions 35
    
    /opt/SUNWvda/sbin/vda revision-sysprep 55
    
    /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.5.9. About Personal Hard Drives and Windows User Profiles

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

Importing and Exporting Windows User Profiles

When you enable personal hard drives, you can also specify a network share as a location for importing and exporting Windows user profiles. This feature is available only for Oracle VM VirtualBox desktops and is supported on Windows 7 and later.

Administrators can specify that user profiles are imported from the network share when users access their personal desktop for the first time. When a user logs in, Oracle VDI searches for a user profile in a location derived by combining the network path of the share and the user's domain Security Accounts Manager (SAM) account name, for example \\MyDomainFileServer\Profiles\jdoe. If the user profile exists in that location, it is copied to the personal hard drive. Once the user profile is copied, the user is logged in. This can cause a delay with the initial login to a desktop.

Administrators can also export the user profiles from the personal hard drives so that the data can be backed up, edited, or re-used. See Section 9.1.9, “Exporting User Profiles from Personal Hard Drives” for details.

The import and export of user profiles is performed using the domain administrator specified in the pool's FastPrep or SysPrep configuration. The domain administrator specified must have read and write permissions for the network share. The firewall on the Active Directory Domain Controller must include the following in the list of allowed programs and features:

  • File and Printer Sharing

  • iSCSI Service

  • Network Discovery

5.5.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. Click 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. (Optional) In the Network Profile Location field, enter the network path of the shared directory to use for importing and exporting Windows user profiles.

    This option is only available for Oracle VM VirtualBox pools.

    Use the Universal Naming Convention (UNC) form for the location, \\ComputerName\SharedFolder, for example \\MyDomainFileServer\Profiles.

  7. (Optional) Select Import User Profile on First User Login.

    This option is only available for Oracle VM VirtualBox pools.

  8. Click OK.

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

Command Line Steps

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

    You cannot configure the settings for importing and exporting Windows user profiles on the command line.

    For example:

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

5.5.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.5.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 higher production priority is allowed to clone more quickly than a pool with lower 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.5.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 controls 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.