7.1 Understanding the Virtual Disk Object

A virtual disk (vDisk) represents any type of physical disk (such as a file-backed disk image, an ISO image file, a physical hard drive, a block device, a CD/DVD device, or a block device) associated to a VM. The vDisk objects are discovered, along with their associated VM, when a “Discover VM Images” job is run on a repository.

The vDisk is modeled as a Grid object, located as a subordinate to the VM Grid object in the Explorer Tree (of the Development Client). In the Explorer Tree, a vDisk is given the form vmname_vDisk<n> where <n> represents the numerical order in which this vDisk was discovered, with 1 being appended to the name of the first vDisk discovered or created. For example, suse11_vdisk1 would be the name of the first disk discovered for a VM with the Grid ID suse11. Each additional vDisk is incremented by one, so the second vDisk in this example would be named suse11_vdisk2.

This section includes the following information:

7.1.1 Creating Or Deleting a vDisk in the Development Client

This section includes the following information:

Creating and Configuring a Virtual Disk

You might want to manually create a vDisk in a scenario similar to any of the following:

  • When you want to create a “blank” disk image file for the VM. In this scenario, the disk image does not actually reside on the file system, but a disk image of the specified size (measured in MB) should be created at the location specified for use by the VM.

    NOTE:This is essentially a blank file, until used by the VM.

  • When PlateSpin Orchestrate might not have discovered the vDisk objects correctly, such as omitting a disk that should exist. You need to manually correct the incorrect discovery.

  • A VM that already exists needs to have patches applied to it. The patches are delivered through an ISO file, which was not configured to be attached to the VM. This configuration lets the administrator configure the VM with access to the ISO disk image, then apply the patches, and then later delete the vDisk object, returning the VM to its original configuration.

    You need to manually add the vDisk, run the Save Config command from the Development Client, and then apply the patches to the running VM. Later, you shut down the VM, delete the vDisk object from PlateSpin Orchestrate, and then run the Save Config command again.

    The scenario includes configuring the VM to use the existing ISO file (create vDisk object, runnning Save Config), and then de-configuring the VM to no longer use the ISO file (delete vDisk object, run saveConfig).

    NOTE:At the end of this scenario, only the vDisk object from PSO is deleted, not the ISO file.

To create a virtual disk in the PlateSpin Development Client, you can either right-click the VM where you want to create the vDisk, then select Create Virtual Disk (if you do this, you can skip to Step 4 below) or you can use the following procedure from the Development Client menu:

  1. From the PlateSpin Development Client, select Actions > Create Virtual Disk to display the Create a New Virtual Disk dialog box.

  2. In the VM drop-down list, select the name of the VM where you want to add a vDisk, then click Create.

  3. When you have created all of the vDisks you need, click Close.

  4. Select the newly created vDisk object in the Explorer tree to view the Info/Groups page of the Admin view.

  5. On the Info/Groups page, configure the following settings:

    • Type: Specifies the vDisk type as the VM host sees it.

    • Description: Describes the vDisk with any text that you choose

    • Healthy: Designates the health state of the vDisk.

    • Moveable: Specifies whether the disk image can be copied (relocated) with the VM when the VM is moved (relocated) to another repository. For more information, see “Moveable” later in this section.

    • Repository: The repository where this disk location path resides.

    • Location: The path (location) to the disk image.

      • If you specify a location to a disk that already exists, the existing disk file is used and the VM configuration is modified accordingly to use this existing disk.

      • If you specify a path to a disk that does not exist, an empty disk image file of the specified size is created.

      • For a vDisk created for a Hyper-V VM, you need to provide the complete path of that vDisk file.

        To form the path, you need to know the repository path where the VM currently resides, the vDisk name, which is the name you give it plus the “ .vhd” extension. For example, the syntax would be

        <value of the “repository.preferredpath” fact>\<your_vhd_filename>.vhd

        HINT:Make sure that the .vhd file you designate in this field doesn’t already exist in the path.

    • Size: The size (measured in MB) of the disk image.

  6. Click the save icon to save the fact changes you have made.

  7. In the Explorer tree, right-click the VM object where you added the vDisk, then select Save Config to apply the changes to the VM’s configuration.

Deleting a Virtual Disk

You might want to manually delete a vDisk in at least two scenarios.

  • When PlateSpin Orchestrate might not have discovered the vDisk objects correctly, such as adding a disk that should not exist. The administrator needs to manually correct the incorrect discovery.

  • A VM that already exists needs to have patches applied to it. The patches are delivered through an ISO file, which was not configured to be attached to the VM. This configuration lets the administrator configure the VM with access to the ISO disk image, then apply the patches, and then later delete the vDisk object, returning the VM to its original configuration.

    The administrator needs to manually add the vDisk, run the Save Config command from the Development Client, and then apply the patches to the running VM. Later, the administrator shuts down the VM, deletes the vDisk object from PlateSpin Orchestrate, and then runs the Save Config command again.

    The scenario includes configuring the VM to use the existing ISO file (create vDisk object, runnning Save Config), and then de-configuring the VM to no longer use the ISO file (delete vDisk object, run saveConfig).

    NOTE:At the end of this scenario, only the vDisk object from PSO is deleted, not the ISO file.

To delete a virtual disk, you can either right-click the vDisk object in the Explorer, then select Delete (if you do this, you can skip to Step 4, below), or you can use the following procedure:

  1. From the PlateSpin Development Client, select the VM object where the vDisk resides, then select Delete Virtual Disk to display the Delete a Virtual Disk dialog box.

  2. In the Source Objects list, select the name of the vDisk (hold down the Ctrl key to select multiple), then click Add to move these objects to the Delete Targets list.

  3. When you have selected all of the vDisks you want to delete, click Delete to display the Delete query dialog box.

  4. In the dialog box, select Apply to all to delete all of the vDisk objects in the Delete Targets list, click OK, then click Close.

  5. In the Explorer tree, right-click the VM object where you deleted the vDisk, then select Save Config to apply the changes to the VM's configuration.

NOTE:The Save Config action rewrites the configuration file for the VM (for example, config.xen), but it does not delete any vDisk files on the file system. In this case, manual deletion of the vDisk file would be required.

7.1.2 Sharing Virtual Disks Among VM Hosts

For a VM to be provisionable by other VM hosts, all of a VM’s vDisks must be visible in the same way that the VM’s default repository (resource.vm.repository) is visible to VM hosts. If a VM has multiple vDisks and each vDisk has a different associated repository, these repositories must also be visible from a potential VM host.

7.1.3 Moving Virtual Disks

When you move a VM to a new repository, all of its moveable vDisk images (see Moveable:) are moved with it to be co-located in the same repository. PlateSpin Orchestrate uses the aggregated size of each moveable vDisk to determine if the designated repository has enough space for all of the disk images. vDisks that are marked as not moveable stay in place and are not used in the calculation for the VM disk size.

The following illustration further explains this concept:

Figure 7-1 Example of Moving Virtual Disks with the VM

  • VM host 1, VM host 2, and VM host 3 all have their own local storage repositories.

  • VM host 1 has a vDisk located on it. It is designated as a moveable vDisk.

  • VM host 1 and VM host 2 are also connected to a shared NAS storage repository.

  • The local repository connected to VM host 1 has a vDisk located on it. It is designated as a moveable vDisk.

  • The shared NAS repository has a vDisk located on it. It is designated as a non-moveable vDisk.

    NOTE:Shared repositories are not created on discovery. They must be manually created and the sharing (visibility) configured.

  • VM host 1 has a VM located on it.

  • VM host 3 cannot communicate with the NAS repository; its vmhost.repositories fact does not include the NAS repository in the array, so that repository is not visible to VM host 3.

If you want to move the VM from VM host 1 to another VM host, PlateSpin Orchestrate manifests the following behavior:

  • The vDisk sizes used by the VM (on local storage and shared storage) are aggregated and compared to free space available on the repositories

  • The only vDisk that would be allowed to copy is the moveable disk. This disk would be copied to either the shared NAS repository or the local storage on VM host 2.

  • VM host 3 would not be considered because it does not have access to the unmoveable disk on the NAS repository.