Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Bug Reference

CLOUDSTACK-4757

Introduction

OVA is an archive or an envelope specification that can contain a complete VM including multiple disks and other files such as ISOs. And CloudStack templates in case of VMware are in OVA format.

Current scenario

CloudStack only supports template creation based on OVA files containing a single disk.

If an Admin/User registers a template using OVA containing more than 1 disk and launches an instance using this template then only the first disk in the OVA is attached to the new instance and the rest of the disks are ignored. 

Purpose

The current behavior needs to be improved to support OVA files with multiple disks

...

  • First disk should be attached to the new instance as the ROOT disk
  • Volumes should be created for the additional disks and attached to the instance as DATA disks

Architecture and Design description

Changes in the existing code flow

VM start orchestration

  • Update CopyCmdAnswer to handle a list of disks instead of a single disk
  • Once the primary storage has been prepared by the underlying hypervisor resource 
    • For all data disks 
      • Create corresponding custom disk-offering with the disk size info
      • Create volume entry in cloud DB using the disk offering created in the previous step
      • Create usage event for the data volume created
    • For root disk 
      • Save disk controller info (IDE or SCSI) into vm_details table in cloud DB

...

Once started, VM will contain ROOT disk, disks requested by the user in the deployVM API and additional disks contained in the template OVA.

Design decision

Traditionally in CloudStack, for any resource entity we first make a DB entry and then create the resource. But with the proposed workflow CS will

...

But today in CloudStack, we lack the capability to understand i.e. parse and manipulate OVA format. And hence offloading the import job to hypervisor and using the results (information about additional disks) provided by the hypervisor will be simpler and reliable.

Minimum OVA requirements
  • Certain OVA restrictions that will continue to hold true
    • All Data disk should be of device type SCSI
      • In CS all data disks are by default of device type SCSI
    • OVA package should not contain ISO disk
    • All NIC devices present in the OVA need to point to default network ‘VM Network’ as most of vCenter installations will have it.
  • The above OVA restriction is because in CS we don't edit or map the NICS in the OVA to CloudStack networks and also cannot configure the controller type for data disks

API/UI/DB Schema

No changes

Upgrade scenario

In a setup that has been upgraded to 4.4 any new VM that is deployed from a template with multiple disks will have multiple volumes attached to it.