You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

Bug Reference

CLOUDSTACK-4757

Branch

Work is in progress in ova-multiple-disks branch

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.

Today in CloudStack, we only support template creation based on OVA files that contain a single disk. If an Admin/User registers a template using OVA that contains more than 1 disk and launches an instance using this template, only the first disk is attached to the new instance and the rest of the disks are ignored. 

Purpose

Purpose of this document is to present functional specifications for improvements that are required to extent the current OVA support to include multiple disks.

Glossary

VM template – Represents a ROOT disk contained in an OVA along with other VM related information like Guest OS.

Datadisk Template - An abstraction for a DATA volume contained in an OVA

Goals

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

In case of an instance launched from a template that is an OVA containing more than 1 disk 

  • 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 additional DATA disks

Scope

Scope of this proposal is limited to adding support for additional disks present in an OVA that is registered in CloudStack. It is not in the scope to fully support an OVA and hence CloudStack will ignore any other information that is encapsulated in the OVA which may include information about the ISO or networks present.

Feature specifications

Currently in CloudStack, template abstraction is that of a VM template that contains a single disk. To represent the additional disks present in an OVA we will introduce the concept of Datadisk templates.

Datadisk templates will be

  • Used to create a data disk from the volume image that is present in the template
  • Stored in vm_templates tables along with the current CS templates
  • Used only when a user tries to deploy a VM from the corresponding VM template and never independently

Datadisk templates will provide flexibility to orchestrate, deploy and manage additional disks present in an OVA like any other Datadisk in CloudStack.

Work flow changes

Template registration

  • No change in user experience during template registration
  • Once template is downloaded and installed in the secondary storage it will be post processed
    • Template post processing will return information about each of the additional data disks present (if any).
    • Information about the data disks will include size of the data disk, path where the template has been installed and the device id
    • For each of the additional disks a Datadisk template will be created
      • Entries will be made in vm_templates and vm_template_store_ref table
      • Template will be referenced to the corresponding VM template by populating vm_template_details for VM template with key value pair - child_template_id,  <datadisk_template_id>

Listing templates

  • All template i.e. both VM and Datadisk templates will be listed.
  • They will be differentiated by the following attributes present in TemplateResponse – bootable, guestos and parenttemplateid

Virtual Machine deployment

  • If user tries to deploy a VM from a template containing multiple disks, user will have to choose a Datadisk offering for every Datadisk template chosen to be deployed along with the VM template
    • If the actual size of the disk exceeds the size of the disk offering then VM deployment will fail
  • During VM create process, when CloudStack makes DB entries for the ROOT disk, Volume DB entries will be made corresponding to each of the Datadisk template
    •  Volume state will be updated to Uploaded state because the volume is already present in secondary storage and has been packaged into an OVA during template post processing
  • During VM orchestration while the storage is being prepared, a volume will be created in primary storage for each of the additional disks
    • Each of the volumes will be migrated from secondary storage to the primary storage chosen by the deployment planner
    • When VM starts it will be booted with all the chosen disks

Template deletion

  • Deletion of DatadiskTemplates will be allowed
  • When a VM template is deleted, the corresponding Datadisk templates will remain

Template Copy

  • When a VM template is copied, all the corresponding Datadisk templates will be copied
  • Copy template will not be supported on a individual Datadisk template

Change in the existing behavior

  • When a user downloads a CS template with multiple volumes, the entity that is downloaded will not be same as the one that was registered
    • The downloaded template will only contain the ROOT disk because when a OVA template is registered it is now consumed and split into 2 or more templates (VMTemplate and DatadsikTemplate(s))

Web Service API

DeployVirtualMachine API

New parameter – disktemplatetodiskofferinglist

  • Mapping from DiskTemplate to DiskOffering
  • If a VM is being deployed from an OVA template that contains additional disks, then during the deployment user will have to choose a Datadisk offering for every Datadisk template he/she chooses to deploy along with the VM template
  • Mutually exclusive with the existing parameter diskofferingid
  • Optional
  • Usage - &disktemplatetodiskofferinglist[0].disktemplateid=2&disktemplatetodiskofferinglist[0].diskofferingid=3

UI Flow

Deploy VM wizard

  • While listing all templates list only VM templates i.e. non Datadisk templates (VM templates will have bootable property set to true)
  • Once the user has selected the VM template allow user to pick between disk offering or Datadisk template with the help of radio buttons (user can choose to select neither)
  • If user chooses disk offering then rest of the work flow will remain the same as today
  • If user chooses Datadisk template then list all the Datadisk templates that belong to the VM template chosen in the first step (templates that have parentTemplateId parameter set to that of VM template)
DB Schema changes

 No schema changes

Upgrade scenario

  • In a setup that has been upgraded to 4.4, templates with multiple volumes
    • That were registered prior to upgrade will continue to operate as before. Any VM launched from these templates will only have the ROOT disk
    • That will be registered after upgrade will follow the new behavior. Any VM launched from these templates will have additional data disks attached to them along with the ROOT disk (i.e. if user chooses to)
  • No labels