Bug Reference
CLOUDSTACK-6142
Branch
4.4, master
Introduction
When a data disk is needed by a virtual machine that resides in a different cluster; that is on a different primary storage than the current cluster/primary storage, it involves a costly and time consuming data copy operation. The volume is copied from one primary storage to another primary storage via the secondary storage. It'll be good to add support for a zone wide primary storage; that is a primary storage that can be shared across clusters.
Purpose
This is a feature specification for supporting zone wide primary storage on Hyper-V.
References
Document History
| Author | Description | Date |
|---|
| Rajesh Battala | Initial Revision | |
| Devdeep Singh | Incorporating comments. | 03/27/2014 |
Glossary
Instance/vm - Virtual machine running on a hypervisor. The terms may be used interchangeably.
ZWPS - Zone wide primary storage
Feature Specifications
- Multiple clusters can share the same primary storage. In cloudstack, Hyper-V is supported only in a zone where there are no other hypervisors besides Hyper-V. A zone wide primary storage will be available to all Hyper-V hosts in the zone.
- Multiple zone wide primary storage can be added per zone.
- A cloudstack setup can have both a cluster wide and zone wide primary storage.
- On upgrade, existing setup will not be impacted. That is, after upgrade, existing cluster wide primary storage will not be impacted and administrator can go ahead and add a zone wide or cluster wide primary storage.
- In cloudstack, currently only SMB 3.0 is supported as a primary storage on Hyper-V. The support for zone wide primary storage will be implemented only for SMB.
- An instance can be deployed with its volumes on a zone wide primary storage.
- A volume can be migrated from one zone wide primary storage to any other shared storage.
- A cloudstack root administrator can live migrate a running instance with its volumes from on host to another host while its volumes migrate from zone wide primary storage to another shared storage.
Test Guidelines
Functional
- Add a zone wide primary storage to a setup. A user should be able to deploy an instance with its volume on the zone wide primary storage.
- If a cluster wide and zone wide primary storage both are available; then when creating a volume with shared disk offering, cloudstack by default looks to place a volume first on a cluster wide storage. Use storage tags on disk offering and zone wide storage pools to make sure volumes get placed on zone wide primary store.
- Validate a volume on a zone wide primary storage and not attached to any instance can be moved/migrated to other shared storage.
- Validate a running instance with its volumes on a zone wide primary storage can be migrated to another host and its volumes also move to another shared storage.
- Have a setup with two clusters and atleast one host in each cluster. Add a cluster wide primary storage to one cluster. Also add a zone wide primary storage. Create an instance in a cluster which has a cluster wide primary storage with the volumes on a cluster wide primary. Live migrate the instance with its volumes to the host in second cluster. It should succeed and the volume of the instance should get live migrated to the zone wide primary store.
- Validate a zone wide primary storage can be put in maintenance mode and removed.
Negative
- Validate a volume on a zone wide primary storage and not attached to any instance cannot be moved/migrated to a local storage and vice verse.
Support-ability Characteristics
- CloudStack management server logs.
- 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"
Users Communities
Only a cloudstack root administrator can add a zone wide primary storage.
Supported Hypervisor
This feature is implemented for Windows Server 2012 R2 and Hyper-V 2012 R2 (Core).
Architecture and Design description
Database changes
There are no db changes for the feature. Existing schema is sufficient to hold information for a zone wide primary storage for Hyper-V too. Information for a zone wide primary storage is stored in the 'storage_pool' table in the db with the scope as 'Zone' and hypervisor type as 'Hyperv'.
Registering zone wide primary storage
- CreateStoragePool api issued with scope as 'zone' and hypervisor type as 'Hyperv'
- Storage pool entry is persisted in the database.
- A ModifyStoragePoolCommand is send to all up and enabled Hyper-V hosts in the zone.
- The host makes a note and persists the zone wide primary storage path in its configuration file.
- On success, the zone wide storage pool state is marked as 'Up' in the database.
- Whenever a new host is added to the zone, ModifyStoragePoolCommand is send to the new host too.
Storage allocation
- When a volume is created, cloudstack queries all the storage allocators for a suitable pool for the volume. It checks with the storage allocators for a suitable pool for the volume in the following order; local, cluster and finally zone wide storage allocator.
- If a suitable pool is found by any of the allocators; then the volume is placed on that pool.
- If a volume is created with a 'Shared' disk offering and a cluster wide and a zone wide pool, both are available; the volume may get placed in either of the pools.
- To guarantee placement of a volume on a zone wide primary storage; storage tags may be used.
Volume migration
- A volume on a shared storage; cluster or zone wide, may be migrated to any other shared storage.
- With storage motion support, a volume attached to a running vm may be migrated from one shared storage to another.
- A data disk which isn't attached to an instance may also be moved/migrated from one shared storage to another.
Web Services APIs
The api 'createStoragePool' can be used for adding SMB as a zone wide primary storage. The 'scope' parameter has to be 'zone' and hypervisor parameter set to 'Hyperv'. This is an existing api and no changes need to be made to it for this feature.
UI flow
- The UI screen for adding a new primary storage should allow adding a SMB as a zone wide primary storage for Hyper-V
IP Clearance
No IP dependencies are introduced by this feature.
Appendix
Appendix A:
Appendix B: