5.1 Deploying a Virtual Machine As a Resource

In order to be able to use a VM as a resource to which you can deploy joblets from your Orchestrator Server, you must deploy or provision a VM. The VM can be deployed to any appropriate VM host machine. If the VM has the Orchestrator Agent installed on it, it can have joblets deployed to it. If you have not yet installed the Orchestrator Agent on the VM, you can give the job to the Orchestrator Server to install the Orchestrator Agent on the next startup of the machine. Template VMs do not need to be provisioned to be used. Instead, if the template VM has the Orchestrator Agent installed on it and a call is made to use a VM template clone, then ZENworks Orchestrator automatically clones a version of the template VM and deploys it.

The Orchestrator Server automatically deploys VMs with the Orchestrator Agent installed on them as it would physical machines, according to one of the default jobs programmed into the Orchestrator Server. As it is needed, the Orchestrator Server takes one of the provisioned VMs and deploys a joblet to it as the job needs the additional resources.

ZENworks Orchestrator uses the Repository Object to represent where VMs are stored. VMs can be stored on local disks, the Orchestrator Datagrid, the VM Warehouse, a network area storage (NAS), a storage area network (SAN), or by using a separate VM technology. Before VMs can be used by ZENworks Orchestrator, you must create Repository objects and then discover the VM Images within the Repository.

5.1.1 Local Repository

A Local Repository represents VMs residing in a VM Host's local storage. The VMs are only visible to the VM Host.

The Xen and VMware server adapters, by default, create a local type Repository object for local VM images when ZENworks Orchestrator accomplishes the Discover VM Hosts action. VMs are searched for in the default paths for each adapter. Do not use Local Repositories for shared directories visible to more than one VM Host. Instead, create a new NAS/SAN type Repository. For information on NAS storage, see NAS Repository. For information on SAN storage, see Storage Area Network Repository.

When discovering VM Images, the adapters use the location, searchpath and preferredpath facts for searching. The repository.location is usually the root path, such as /. For Xen, the adapter creates a Local Repository with search paths of /etc/xen/vm and a preferred search path of /var/lib/xen/images.

When the Discover VM Images is run, the provisioning adapter follows these steps:

  • Concantenates the repository.location and every element of repository.searchpath and searches for VMs in those directories.

  • Concantenates the r epository.location and repository.preferredpath and searches for VMs in that directory.

NOTE:These steps are also followed when searching in NAS and SAN repositories when representing auto-mounted file systems, and when the location, search path, and preferred path are set.

5.1.2 Datagrid Repository

The Datagrid Repository represents VMs residing in the ZENworks Orchestrator Datagrid, which is a storage area on the Orchestrator Server. By default, a Datagrid Repository named zos is automatically created. The zos Datagrid Repository has a location of grid:///vms, which points to an area in the Datagrid reserved for VM archival storage. You can store VMs to the Datagrid and deploy to a VM host as necessary. The storage is archival because VMs cannot be run from the Datagrid Repository. You must move VMs out of the DataGrid to a VM Host in order to run them.

5.1.3 Warehouse Repository

The Warehouse Repository represents the VMs stored in the VM Warehouse Server. If you have installed the VM Warehouse Server, then run Discover VM Hosts, the Xen adapter creates a Warehouse Repository named Warehouse. Running Discover VM Images on the Warehouse Repository display the inventory of Gold Master VMs in ZENworks Orchestrator. These are the Gold Master versions stored in the VM Warehouse. The discovered Gold Master VMs can then be provisioned to VM Hosts. VMs cannot run from the warehouse Repository, so any provisioning actions first export a VM from the warehouse. The Warehouse Repository is supported only by the Xen adapter.

5.1.4 NAS Repository

The NAS Repository represents VMs stored in a NAS. This is a storage where VMs are visible to multiple VM Hosts, so they can be run by any one of the available hosts. The following procedure shows an example of setting up a NAS Repository. For the example, assume you have a Xen setup where the directory /vms is auto-mounted on multiple VM hosts as the shared storage location for your VMs.

  1. Create a new Repository object. In Orchestrator Console, click Actions > Create Repository.

  2. Specify a new name and choose which adapter group this Repository is used for.

    The example is for Xen VMs, so choose the xen30 adapter.

  3. Close the dialog box to display the Info/Groups tab for the new repository.

  4. Set the location path. This is the root path for the repository. It is usually /.

  5. Set the search path and preferred path.

    In this example, the vms are all in /vms, so leave searchpath empty and set the preferredpath == "vms".

  6. Select the VM Host objects that have visibility to the shared directory and add the new repository to the VM hosts list of available Repositories. To find a VM host, either go the VM Hosts view or open the Physical tree under Resources and open the physical host representing the VM host.

  7. Run Provision > Discover VM Images on the new Repository.

5.1.5 Storage Area Network Repository

The Storage Area Network (SAN) Repository is a single storage server that can be accessed by multiple machines.

NOTE:This section refers to an iSCSI SAN, not a Fibre Channel SAN.

There are two ways to access VMs on a SAN:

  • The SAN is auto-mounted. For an auto-mounted SAN, follow the setup steps noted in NAS Repository in just setting the facts for identifying the paths.

  • The Orchestrator Server managing the connection requires additional information to have the SAN as an available repository for VM images. For example, the physical disks are on the SAN, but the configuration file is on local storage. The additional information is necessary for ZENworks Orchestrator to know how to bind or connect the SAN disk on the VM host.

Setting Up the SAN

For information on setting up an iSCSI target, see Setting Up an iSCSI Target in the SUSE Linux Enterprise Server 10 Installation and Administration Guide.

For information on setting up an iSCSI Initiator, see Configuring iSCSI Initiator in the SUSE Linux Enterprise Server 10 Installation and Administration Guide.

You need to have one of the following for the setup:

  • On the server, create a file or partition that has sufficient size for a VM image.

  • Have or select a VM disk image.

You can set up the iSCSI target according to the linked directions above, or you can use a VM image as your target.With the addition of the optional instructions on installing on a VM Image are included here.

NOTE:If iSCSI Target is not installed, you will be prompted to install the iscsitarget package.

To install the target (iSCSI Server):

  1. Open YaST2.

  2. Click iSCSI Target in the Miscellaneous section.

  3. Select the When Booting option in the Service Start section.Select the Global tab and set up global authentication if needed. If you are not using authentication, select No Authentication.Select the Targets tab.

  4. There should be a default iSCSI target in the Targets list. Delete this example target.

  5. Click Add.

  6. Click Add again.

  7. Select Type=fileio.

  8. Specify the path to the created partition, file, or VM Image.

  9. Click OK.

  10. Click Next.

  11. Specify any authentication information for incoming or outgoing stored VMs, or select No Authentication.

  12. Select Finish. A dialog box appears, asking you to restart the service.

  13. Click Yes.

After you have installed and configured your iSCSI Target and Initiator, run $hwinfo -disk to see something similar to the following:

Model: "IET VIRTUAL-DISK"  Vendor: "IET"  Device: "VIRTUAL-DISK"  Revision: "0"  Driver: "sd"  Device File: /dev/sdb (/dev/sg2)

NOTE:Notice the virtual disk and the new device file that appear. This shows that the iSCSI initiator has established a connection and is able to attach to the file, partition, or VM image. If this information does not appear, troubleshoot the iSCSI connection and setup.

These following steps are used to create a Xen configuration file and start the VM:

  1. Type $virt-manager at a command line prompt.

  2. Either create a new VM or select “I have a disk or disk image”

  3. Select Disks.

  4. Enter the new device file location as found in the hwinfo -disk command output.

Configuring the iSCSI SAN Inside ZENworks Orchestrator

After you have set the SAN up outside of ZENworks Orchestrator, launch the Orchestrator Console. Perform the following steps if your iSCSI SAN is a VM Image:

  1. Click Provision > Discover VM Images.

  2. Ensure that the new VM appears on the tree.

  3. Right-click Repositories and select New Repository.

  4. Name the new repository.

  5. Add the xen30 provisioning adapter.

  6. Click Create.

  7. Select the new repository from the list.

  8. In the large window on the right, fill in the following information:

    • Type = SAN

    In the SAN Specific Configuration section, fill in the following information:

    • SAN Type = iSCSI

    • SAN Vendor = "iqn"

  9. Select Save from the toolbar icon or the file menu.

  10. Click the Resources selection in the tree.

  11. Select the new VM.

  12. On the right select Info/Groups and select the Browse button (…). find the Virtual Disks Layout

  13. Click the drop-down menu to change the information.

    For example:

    iqn: iqn.2007-05.lab.cimlocation: phy:/dev/sdbmoveable: left uncheckedrepository: iscsisize: 0 (untouched)
    
  14. Test the new setup by provisioning a VM.

  15. Check the Job Log for bind/unbind operations similar to this:

    iscsi unbind(iqn=iqn.2007-05.lab.cim,u=None,pw=None,auth=None) Running 'iscsiadm -m node' rslt= 0 Found record for iqn: e375f3 Run cmd: iscsiadm -m node -r e375f3 -urslt= 0unbind was successful
    

Virtual Repository

A Virtual Repository is where ZENworks Orchestrator assumes the VM store is handled by the underlying VM technology. For example, the Virtual Repository is used by the Virtual Center adapter because Virtual Center is managing the VM storage.