Bug Reference

CLOUDSTACK-6288

Branch

4.4, master

Introduction

As enterprise workloads for virtual environments grow in size and in performance demands, virtual hard disk (VHD) formats need to accommodate them. Hyper-V in Windows Server 2012 introduces a new version of the VHD format called VHDX, which is designed to handle current and future workloads. VHDX has a much larger storage capacity than the older VHD format. It also provides data corruption protection during power failures and optimizes structural alignments of dynamic and differencing disks to prevent performance degradation on new, large-sector physical disks.

Currently in cloudstack, only VHD virtual disk format is supported for Hyper-V. With this feature support for VHDX format will also be enabled for Hyper-V.

Purpose

This is a feature specification for supporting VHDX image format for Hyper-V.

References

Document History

AuthorDescriptionDate
Devdeep SinghInitial Revision3/27/2014

Glossary

Instance/vm - Virtual machine running on a hypervisor. The terms may be used interchangeably.

Feature Specifications

  1. A user should be able to register a template of type VHDX for Hyper-V. Functionality of being able to register a template of type VHD for Hyper-V should continue to work
  2. A user should be able to create an instance on Hyper-V from template of type VHDX as well as VHD.
  3. Following operation should work for volumes of type VHDX.
    1. Migrating a volume from one storage pool to another.
    2. Downloading a volume.
    3. Creating a template from volume.
    4. Downloading a template.
    5. Storage motion of volumes.
      1. Live migrating a volume attached to a running vm from one storage pool to another.
      2. Live migrating an instance with its volumes from host to another while the volumes migrate from one storage pool to another.
  4. All data disks that are allocated and created on Hyper-V will be of type VHDX.
  5. A cloudstack Hyper-V setup that has been upgraded from 4.3 may have existing root and data volumes of type VHD. All the supported operations; as listed in point 3 above; on these volumes should continue to work.
  6. An instance can have virtual disks of type VHDX and VHD, both attached to it.

Test Guidelines

Functional
  • User should be able to register a template of type VHDX or VHD for Hyper-V.
  • User should be able to create instances from templates of type VHDX and VHD.
  • Validate all the supported operations on volumes of type VHDX and VHD. Supported operations include
    • Migrating a volume from one storage pool to another.
    • Downloading a volume.
    • Creating a template from volume.
    • Downloading a template.
    • Storage motion of volumes.
  • On creating a template from a VHDX volume, validate that the template.properties file on secondary storage has the correct format set in it. On restart, of the management server; the template is preserved on secondary storage and is usable.
  • An instance can be created from a template created from a volume of type VHDX.
  • Data disks that are allocated and created are of type VHDX. The format should be set to VHDX in the volume table. Also validate that the volume created is of type vhdx on the hypervisor.
  • All volumes created from a template of type VHDX should have the format type set to VHDX in the volumes table.
  • On a Hyper-V setup upgraded from older release (4.3); attach a data disk to a volume. It should be successful. The data disk should have been created on older release so that its format is set to VHD. After upgrade, the data volume should get successfully attached and its format type should stay as VHD in the volume table.

Support-ability Characteristics

Logs can be looked up at the following location

  • The Hyper-V agent logs can be seen in windows event viewer on the respective hosts. The logs can be filtered by source "CloudStack Hyper-V Agent".

Configuration Characteristics

There are no configurable options available for VHDX support

Users Communities

CloudStack administrators and users, both can register a template, create instance from a template, attach data volumes, download volumes and template and create template from volumes with format as VHDX. This is the existing behavior and none of these operations are affected by this feature.

Supported Hypervisor

This feature is implemented for Windows Server 2012 R2 and Hyper-V 2012 R2 (Core).

Use cases

  • Registering a template of format VHDX for creating instances.
  • Data disks attached to an instance should be created of type VHDX.
  • Creating templates from volumes of type VHDX.

Architecture and Design description

Database modifications

There are no database schema changes for this feature. The existing schema is sufficient to hold the format type for volumes and template.

  • For volumes, VHDX volume type information is kept in the 'format' column in the 'volumes' table.
  • For templates, VHDX template type information is kept in the 'format' column in the 'vm_template' table.
Creating and attaching volumes
  • When a volume is created in cloudstack, it stays in allocated state and is only an entry in the database. It is not until the volume is attached to an instance that the volume gets actually created on the primary store.
  • When cloudstack has to physically create a volume on the storage pool; it sends a CreateObjectCommand to the hypervisor on which the storage pool is accessible.
  • The Hyper-V agent interprets this command and creates a virtual disk of the requested size on the storage pool. The agent will create a dynamic disk of type VHDX on the storage pool. Earlier it always created the virtual disk to be of type VHD.
  • On successful completion of the CreateObjectCommand the format field is updated to VHDX for the volume on the database.
  • AttachCommand is send to the hypervisor to attach the volume to a given instance.
Creating template from volume/Registering a template
  • For creating a template from a volume, a CopyCommand is send to the Hyper-V agent for copying the volume from primary storage pool to the secondary storage.
  • Hyper-V agent after copying the volume to the secondary storage pool also creates a template.properties file on the secondary storage.
  • The format type should be set to VHDX for the template in the properties file when the template is created from volume of type VHDX.
  • Similarly, the entry in the database should also be set to the VHDX in format field for the template.
  • While registering a new template too, the format should be set to VHDX in the vm_template table in the database.

Web Services APIs

Api 'registerTemplate' is used for registering a template in cloudstack. While registering a template 'vhdx', should be passed in the format type parameter.

UI flow

While registering a template a option is provided for registering a template of format VHDX for Hyper-V. With this change a user can now register a template of type VHD or VHDX for Hyper-V.

IP Clearance

No IP dependencies are introduced by this feature.

Appendix

Appendix A:

Appendix B:

  • No labels