9.2. Managing Templates

9.2.1. Obtaining the ID of a Template
9.2.2. Importing a Template
9.2.3. Renaming a Template
9.2.4. Starting a Template
9.2.5. Restarting a Template
9.2.6. Connecting to the Template Console
9.2.7. Applying a Template to a Pool for Cloning
9.2.8. Copying a Template to a Desktop
9.2.9. Exporting a Template
9.2.10. Updating the VirtualBox Guest Additions in a Template
9.2.11. Mounting an ISO Image in a Template
9.2.12. Unmounting an ISO Image from a Template
9.2.13. Reverting a Template to the Latest Revision
9.2.14. Shutting Down a Template
9.2.15. Powering Off a Template
9.2.16. Deleting a Template

This section lists the available actions for templates, how you perform the action in Oracle VDI Manager, and the equivalent command-line command.

9.2.1. Obtaining the ID of a Template

Whenever you use the vda command to perform an action to a template, you must use the unique ID of the template rather than the name. Oracle VDI Manager only displays the name.

To obtain the ID of a template, use either the vda pool-templates command to list the templates in a pool, or the vda provider-list-templates command to list the templates for a desktop provider.

In the following example, the templates in the pool MyPool are listed:

/opt/SUNWvda/sbin/vda pool-templates MyPool
NAME             ID   MACHINE_STATE                MASTER      DESKTOPS
template1         2     Powered Off  template1 Revision 2            10
template2         6     Powered Off  template2 Revision 1            15

In the following example, the templates for the desktop provider MyProvider are listed:

/opt/SUNWvda/sbin/vda provider-list-templates MyProvider
NAME                ID             DIRECTORY
template1           2              MyCompany
template2           6              MyCompany

9.2.2. Importing a Template

Perform the following steps to import a previously created virtual machine into Oracle VDI Manager as a template for desktop cloning. After the import, a first revision is created. The revision can be used for cloning in any pool that uses the same desktop provider.

You can perform this action on Oracle VM VirtualBox, Microsoft Hyper-V, VMware vCenter and Generic templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab.

  3. Click the Import Template button to open the Import Template window.

  4. If the virtual machine to import as a template is located on a VirtualBox host available to Oracle VDI Manager, go to the Hypervisor tab and select the virtual machine in the list.

    Otherwise, specify the location of the virtual machine configuration file and disk image by completing the fields in the Folder tab.

  5. Click OK to start the template import process.

    When the import is complete, the first revision of the template is available for cloning.

Command Line Steps

  • Import a VirtualBox template using the vda pool-vb-import command.

    /opt/SUNWvda/sbin/vda pool-vb-import -p \
    vdi-image=MyVirtualDesktop.vdi,xml-configuration=MyVirtualDesktop.xml,\
    hostname=MyNfsServer.domain,path=/home/user/desktops,type=template MyPool
    
  • Import an unmanaged VirtualBox template using the vda pool-vb-import-unmanaged command.

    /opt/SUNWvda/sbin/vda pool-vb-import-unmanaged -p \
    type=template -d uuid-desktop MyPool
    
  • Import a Hyper-V template using the vda pool-hv-import command.

    /opt/SUNWvda/sbin/vda pool-hv-import -p \
    export-directory=/home/user/desktops,hostname=MyNfsServer.domain,type=template MyPool
    

9.2.3. Renaming a Template

Perform the following steps to give a new name to an existing template.

You can perform this action on Oracle VM VirtualBox and Microsoft Hyper-V templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab and select the template you want to work with.

  3. Click the Rename button.

    A dialog box is displayed.

  4. Enter the new name for the template and click OK.

Command Line Steps

  1. Obtain the ID of the template you want to work with, see Section 9.2.1, “Obtaining the ID of a Template”.

  2. Rename an existing template using the vda template-setprops command.

    /opt/SUNWvda/sbin/vda template-setprops -p name=new-name template-id
    

    For example:

    /opt/SUNWvda/sbin/vda template-setprops -p name='"Windows 7 pro"' 9

9.2.4. Starting a Template

Perform the following steps to start the virtual machine on the host in order to apply modifications to the template.

You can perform this action on Oracle VM VirtualBox and Microsoft Hyper-V templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab and select the templates you want to work with.

  3. In the More Actions list, select Start.

Command Line Steps

  1. Obtain the ID of the templates you want to work with, see Section 9.2.1, “Obtaining the ID of a Template”.

  2. Start the templates using the vda template-start command.

    /opt/SUNWvda/sbin/vda template-start template-id-1 template-id-2 ...
    

    For example:

    /opt/SUNWvda/sbin/vda template-start 9 13

9.2.5. Restarting a Template

Perform the following steps to restart the template virtual machine on the same host. The action is equivalent to pressing the reset button on your PC.

Caution

Restarting a template virtual machine can cause data loss if files are open.

You can perform this action on Oracle VM VirtualBox and Microsoft Hyper-V templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab and select the templates you want to work with.

  3. In the More Actions list, select Restart.

    A confirmation dialog box is displayed.

  4. Click OK.

Command Line Steps

  1. Obtain the ID of the templates you want to work with, see Section 9.2.1, “Obtaining the ID of a Template”.

  2. Restart the templates using the vda template-restart command.

    /opt/SUNWvda/sbin/vda template-restart template1-id template2-id ...
    

    For example:

    /opt/SUNWvda/sbin/vda template-restart 9 13

9.2.6. Connecting to the Template Console

Perform the following steps to connect to the console that provides direct access to the template.

You can only open the template console in Oracle VDI Manager.

You can perform this action on Oracle VM VirtualBox templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab and select the template you want to work with.

  3. Click the Open Console button.

    The template console is displayed in a separate browser window.

  4. Click Connect.

9.2.7. Applying a Template to a Pool for Cloning

Perform the following steps to configure a pool that has automatic cloning enabled, so that any fresh desktops for the pool will be cloned from the template that has been applied for cloning.

You can perform this action on Oracle VM VirtualBox and Microsoft Hyper-V templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab and select the template you want to work with.

  3. In the More Actions list, select Apply for Cloning in Pool.

    The Apply for Cloning window is displayed.

  4. Select the pools you want to apply the template to.

  5. Click OK.

Command Line Steps

  1. Obtain the ID of the template you want to work with, see Section 9.2.1, “Obtaining the ID of a Template”.

  2. Apply a template for cloning to a pool using the vda pool-setprops command.

    /opt/SUNWvda/sbin/vda pool-setprops -p template=template-id MyPool
    

    For example:

    /opt/SUNWvda/sbin/vda pool-setprops -p template=9 MyPool

9.2.8. Copying a Template to a Desktop

Perform the following steps to turn a template into a usable desktop inside the current pool. The newly created desktop appears in the Desktop tab of the pool, ready for user assignment. The template remains available as a template as well.

You can perform this action on Oracle VM VirtualBox and Microsoft Hyper-V templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab and select the template you want to work with.

  3. In the More Actions list, select Copy to Desktop.

    A confirmation dialog box is displayed.

  4. Click OK.

Command Line Steps

  1. Obtain the ID of the template you want to work with, see Section 9.2.1, “Obtaining the ID of a Template”.

  2. Copy the template to a new desktop using the vda template-desktop command.

    /opt/SUNWvda/sbin/vda template-desktop template-id
    

    For example:

    /opt/SUNWvda/sbin/vda template-desktop 9

9.2.9. Exporting a Template

Perform the following steps to save the template's virtual machine configuration file and disk image to a location of your choice. You can then store and use this virtual machine independent of the Oracle VDI environment.

The export consists of an .xml file containing the virtual machine properties, and a .vdi disk image file.

You can perform this action on Oracle VM VirtualBox templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab and select the template you want to work with.

  3. In the More Actions list, select Export Template.

    The Export Template window is displayed.

  4. Specify the export location for the desktop by entering a target Server and Path, and a Name for the exported desktop.

  5. Click OK.

Command Line Steps

  1. Obtain the ID of the template you want to work with, see Section 9.2.1, “Obtaining the ID of a Template”.

  2. Export an existing template using the vda template-export command.

    /opt/SUNWvda/sbin/vda template-export -p \
    hostname=MyNfsServer.domain,path=/path-to-export-location template-id
    

    For example:

    /opt/SUNWvda/sbin/vda template-export -p \
    hostname=nfs.example.com,path=/home/user/exports 9

9.2.10. Updating the VirtualBox Guest Additions in a Template

Perform the following steps to update a template to the version of the Guest Additions included in the current VirtualBox installation on the desktop provider. The template must be powered off. A job is started that starts the virtual machine, installs the Guest Additions, and then shuts down the virtual machine again.

To propagate the new VirtualBox Guest Additions to the cloned desktops in a pool, be sure to create a new revision from the updated template, and make it the new cloning master.

You can only update the Guest Additions in Oracle VDI Manager.

You can perform this action on Oracle VM VirtualBox templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab and select the template you want to work with.

  3. In the More Actions list, select Update Guest Additions.

    A message is displayed to confirm that the update job has started.

9.2.11. Mounting an ISO Image in a Template

Perform the following steps to mount an ISO image to a template's virtual DVD drive. The ISO image must be stored on a Network File System (NFS) share that is accessible from the Oracle VDI Manager host.

You can perform this action on Oracle VM VirtualBox and Microsoft Hyper-V templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab and select the template you want to work with.

  3. In the More Actions list, select Mount ISO Image.

    The Mount ISO Image window is displayed.

  4. Specify the ISO image location by entering the Server and Path.

  5. Click Select Folder to load the available ISO images into the list.

  6. Select an ISO image from the list.

  7. Click OK.

Command Line Steps

  1. Obtain the ID of the template you want to work with, see Section 9.2.1, “Obtaining the ID of a Template”.

  2. Mount an ISO image using the vda template-mount-iso command.

    /opt/SUNWvda/sbin/vda template-mount-iso -p \
    hostname=MyNfsServer.domain,path=/path-to-iso-file templates-id
    

    For example:

    /opt/SUNWvda/sbin/vda template-mount-iso -p \
    hostname=nfs.example.com,path=/home/user/iso/myDVD.iso 38

9.2.12. Unmounting an ISO Image from a Template

Perform the following steps to unmount an ISO image from a template's virtual DVD drive.

You can perform this action on Oracle VM VirtualBox and Microsoft Hyper-V templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab and select the template you want to work with.

  3. In the More Actions list, select Unmount ISO Image.

Command Line Steps

  1. Obtain the ID of the template you want to work with, see Section 9.2.1, “Obtaining the ID of a Template”.

  2. Unmount an ISO image using the vda template-unmount-iso command.

    /opt/SUNWvda/sbin/vda template-unmount-iso template-id
    

    For example:

    /opt/SUNWvda/sbin/vda template-unmount-iso 38

9.2.13. Reverting a Template to the Latest Revision

Perform the following steps to revert a template back to its most recent revision. The current state of the virtual machine, and any changes made, are discarded.

You can perform this action on Oracle VM VirtualBox and Microsoft Hyper-V templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab and select the template you want to work with.

  3. In the More Actions list, select Revert.

    A confirmation dialog box is displayed.

  4. Click OK.

Command Line Steps

  1. Obtain the ID of the template you want to work with, see Section 9.2.1, “Obtaining the ID of a Template”.

  2. Revert a template to its latest revision using the vda template-revert command.

    /opt/SUNWvda/sbin/vda template-revert template-id
    

    For example:

    /opt/SUNWvda/sbin/vda template-revert 9

9.2.14. Shutting Down a Template

Perform the following steps to send the ACPI shutdown signal to the template virtual machine.

You can perform this action on Oracle VM VirtualBox and Microsoft Hyper-V templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab and select the templates you want to work with.

  3. In the More Actions list, select Shut Down.

    A confirmation dialog box is displayed.

  4. Click OK.

Command Line Steps

  1. Obtain the ID of the templates you want to work with, see Section 9.2.1, “Obtaining the ID of a Template”.

  2. Shut down the templates using the vda template-stop command.

    /opt/SUNWvda/sbin/vda template-stop template1-id template2-id ...
    

    For example:

    /opt/SUNWvda/sbin/vda template-stop 9 13

9.2.15. Powering Off a Template

Perform the following steps to power off the template virtual machine immediately. The template is unregistered from the virtualization host at the same time.

You can perform this action on Oracle VM VirtualBox and Microsoft Hyper-V templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab and select the templates you want to work with.

  3. In the More Actions list, select Power Off.

    A confirmation dialog box is displayed.

  4. Click OK.

Command Line Steps

  1. Obtain the ID of the templates you want to work with, see Section 9.2.1, “Obtaining the ID of a Template”.

  2. Power off the templates using the vda template-stop command.

    /opt/SUNWvda/sbin/vda template-stop -p template1-id template2-id ...
    

    For example:

    /opt/SUNWvda/sbin/vda template-stop -p 9 13

9.2.16. Deleting a Template

Perform the following steps to remove the template and all associated revisions from Oracle VDI.

You can perform this action on Oracle VM VirtualBox and Microsoft Hyper-V templates.

Oracle VDI Manager Steps

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

  2. Click the Template tab and select the templates you want to work with.

  3. In the More Actions list, select Delete.

    A confirmation dialog box is displayed.

  4. Click Delete.

Command Line Steps

  1. Obtain the ID of the templates you want to work with, see Section 9.2.1, “Obtaining the ID of a Template”.

  2. Delete the templates using the vda template-delete command.

    /opt/SUNWvda/sbin/vda template-delete template1-id template2-id ...
    

    For example:

    /opt/SUNWvda/sbin/vda template-delete 9 13