...
In today's implementation, VMware DataCenter is invisible to CloudStack. CloudStack recognizes and manages cluster as resource container. There is no restriction on which over the DC or vCenter to which vCenter instance the cluster, that is being added to cloudstack zone, belongs to. This implies following,
...
To address these issues, Cloudstack should explicitly manage vSphere DCs. Treat CloudStack zone as capacity-planning and operating unit, in case of deployment with multiple DCs use multiple CloudStack zones configured one per DC and share the same network infrastructure, they only need to carefully allocate resources like IPs/VLANs etc. to multiple CloudStack zones to make it happen.
...
This document describes the specifications and design of new data model for cloudstack zone for in VMware environment.
References
...
Author | Description | Date |
|---|
Sateesh Chodapuneedi | Initial Revision | 04/09/2013 |
Sateesh Chodapuneedi | Proposed Feature Specification | 04/21/2013 |
Glossary
DC - VMware vCenter Data Center.
zone - CloudStack zone.
N1kv - Cisco Nexus 1000v Distributed Virtual Switch
ASA1kv - Cisco Adaptive Security Appliance 1000v
vDS - VMware vNetwork Distributed Virtual Switch.
vSwitch - VMware vNetwork Standard Virtual Switch
dvPortgroup - VMware vNetwork Distributed Virtual Portgroup
Portgroup - VMware vNetwork Standard Virtual Portgroup
...
- All VMware test cases need to be covered, as new mapping of DC to CloudStack zone is a change in critical path of VMware hypervisor plugin.
Hypervisor support
- VMware ESXi 4.1 or later.
Negative usage scenarios
- A DC should not be allowed to be part of multiple CloudStack deployments.
- In a CloudStack deployment, a DC should be associated with only one CloudStack zone.
Supportability characteristics
Logging
VMware hypervisor plugin logs all the successful operations to INFO, all exceptions/failures to ERROR, and all synchronization checks to DEBUG.
Debugging/Monitoring
In addition to looking at the management server logs, administrators can look up the vcenter logs for analysis.
Use cases
It allows the system administrator to configure cloudstack zone per DC to manage all the the resources in DC.
- All DC wide features would be available across cloudstack zone consistently.
- Zone wide virtual network orchestration is supported using distributed virtual switch (VMware DVS, Nexus 1000v DVS) in a DC. A virtual machine can move across clusters in zone while its dvNics are connected to dvPortgroup of dvSwitch in the DC.
- A DC wide datastore could be used as zone wide primary storage facilitating virtual disk accessibility across clusters in zone.
- Test upgrade to new product (with this feature) when the deployment already has multiple zones, where clusters in each zone encompasses one or more of following,
- Single DC
- Multiple DCs
- Multiple vCenters
- After upgrade, test adding new cluster to existing/new zone, where the cluster belongs to a DC/vCenter that is,
- Already part of zone
- Not part of zone
- Test creation of new zone
Hypervisor support
- VMware ESXi 4.1 or later.
Negative usage scenarios
- A DC should not be allowed to be part of multiple CloudStack deployments.
- In a CloudStack deployment, a DC should be associated with only one CloudStack zone.
Supportability characteristics
Logging
VMware hypervisor plugin logs all the successful operations to INFO, all exceptions/failures to ERROR, and all synchronization checks to DEBUG.
Debugging/Monitoring
In addition to looking at the management server logs, administrators can look up the vcenter logs for analysis.
Use cases
It allows the system administrator to configure cloudstack zone per DC to manage all the the resources in DC.
- All DC wide features would be available across cloudstack zone consistently.
- Zone wide virtual network orchestration is supported using distributed virtual switch (VMware DVS, Nexus 1000v DVS) in a DC. A virtual machine can move across clusters in zone while its dvNics are connected to dvPortgroup of dvSwitch in the DC.
- A DC wide datastore could be used as zone wide primary storage facilitating virtual disk accessibility across clusters in zone.
Architecture Architecture and Design description
- Vmware datacenter will be put under management of CloudStack zone.
- In this explicit model, CloudStack will understand the relationship between a Vmware datacenter and resources underneath it, so when resources like a Vmware cluster or dvSwitch that is added to CloudStack, the underlying Vmware resource relationship between these objects will become constraint information for CloudStack to use. For example, a Vmware cluster can't be added to a CloudStack zone if it's Vmware DC is not under the CloudStack zone, also an ASA ASA1kv instance cannot be added to a Vmware cluster that if its Vmware DC is not in the zone. The model itself will not limit how many Vmware clusters that a N1kv VSM instance or ASA ASA1kv or vDS will manage, as long as N1kv or ASA ASA1kv or vDS and its managed cluster are within the same Vmware DC.
- CloudStack should be able to add/manage following DC level resources in scope of zone.
- Clusters
- Datastores for zone wide storage
- Distributed virtual switches for zone wide virtual networks.
- Nexus 1000v DVS
- VMware DVS - this is already realized by zone wide traffic labels.
- vDS/N1kv/ASA1kv (in future, see "Out of scope" section)
- Upgrade to latest product (with this feature) does not enforce migration of existing CloudStack zones. This means that if an existing zone has clusters from multiple DCs/vCenters, it will be supported as-is. But zone wide features would not be supported on such zone. To quote some, zone wide primary storage, storage live migration across clusters in a zone.
- During upgrade all zones with clusters from single DC would not be marked as legacy, otherwise marked as legacy.
- Expansion of legacy zone is allowed. Expansion means adding more resources (like cluster).
- A zone created after upgrade would be allowed to have only single DC.
- New API would be added to associate a zone with a DC. Validation of DC name should happen during this operation.
- New API would be added to dis-associate a zone from a DC.
- Following constraint checks would be done while adding DC level resource (listed above) to zone. These constraints would not be applicable to legacy zones.
- Only clusters of the zone's associated DC can be added to a zone.
- Retrieve name of DC which encompasses this cluster. Compare the retrieved DC name with name of DC (being) associated with this zone.
- DC is not associated with any other zone already.
- Check guid, of new DC being added, doesn't already exist in table 'cloud'.'zone_vmware_data_center
Constraint checks - Only clusters of the associated DC can be added to a zone.
- Retrieve name of DC which encompasses this cluster. Compare the retrieved DC name with name of DC (being) associated with this zone.
- Only N1kv VSM of the associated DC can be added to a zone.
- N1kv's vCenter server connection's properties would need to be checked to retrieve the association of N1kv with a vCenter and a DC. Compare the retrieved vCenter IP and DC name with vCenter IP and DC name of current zone
- DC is not associated with any other zone already.
- Check guid, of new DC being added, doesn't already exist in table 'cloud'.'data_center_zone_map'. The guid is a string that encapsulates MOR of DC and vCenter host name/ip. By tracking both vCenter host name/ip and MOR of DC, it's possible to distinguish DC's across multiple vCenters.
- DC is not associated with any other cloudstack CloudStack deployment.
- Check custom property over VMware's DC object if this DC is already associated with a zone of a cloudstack CloudStack deployment. Custom property of type boolean can represent this, 'cloudstackzone'
- While adding resource to cloudstack zone, approaches to apply constraint checks are,
- Track relationship between resources (DC <-> Cluster <> DataStore <-> DVS <> N1kv <-> ASA etcetc.) in cloudstack CloudStack database - suffices within single CloudStack deployment. Cannot detect if multiple CloudStack deployments are managing same resource (DC, DataStore etc.)
- Use custom property on VMware object as flag. This works across cloustack CloudStack deployments but proper cleanup is required upon removal.
- During discovery process, VmwareServerDiscoverer might have to retrieve vCenter host/ip & credentials from database given zone_id, because they are made optional parameters because this data is already available in database when the zone is associated with first cluster. Construct connection url from this data.
- While re-loading resource make sure connection url is defined correctly, could be retrieved from vmware_data_dc center table (guid).
- AddCluster changes
- If a row matches zone_dc_map.zone id and if DC name is not specified, DC name can be retrieved from vmware_dc table and used. If DC name is specified, validation of DC name should happen.
- In VmwareServerDiscoverer, implement constraint checks while adding a cluster as mentioned in design section.
- Update vmware DC properties in cloud.vmware_dc table (Say DC name changes in vCenter)
- While adding VMware cluster to zone, check if zone_dc_map is empty or not. If empty, while adding this cluster we need to associate corresponding DC to zone. Hence do following,
- Update tables cloud.zone_dc_map and cloud.vmware_dc to associate DC with zone
- If N1kv instance is specified, update table cloud.virtual_supervisor_module and cloud.zone_vsm_map to assocaite N1kv VSM instance with zone
- Set custom property over VMware DC object. If not already present, add boolean property 'cloudstackzone' with value 'true'. If the property is already present, just set it to 'true'. Now this DC cannot be associated with any other cloudstack zone.
- Allow multiple N1kv VSM instances to be added to zone.
- Avoid cascaded removal of VSM instance upon cluster deletion as the association is now at zone level.
- Change cleanup code of N1kv VSM instances as cleanup should happen automatically with zone removal instead of cluster removal earlier.
- DeleteCluster changes
- While deleting check if this is last cluster in the zone. If so, dis-association of DC to zone should be done. Hence do following,
- Cleanup tables cloud.zone_dc_map and cloud.vmware_dc for specific zone by removing entries by zone_id (if zone_id in row matches data_center.id then remove the row)
- Set the zone's corresponding DC object's property to 'false'. Now this DC can be associated with any other cloudstack zone.
Database modifications
- Associate DC to zone changes,
- Validate DC
- Validate zone
- Check if DC is associated with any other zone in current deployment.
- Check if DC's custom property 'cloudstackzone' is set to "true" or "false". If "true" fail the operation.
- Update database to add information of DC to table 'cloud'.'vmware_data_center'
- Update table 'cloud'.'zone_vmware_data_center_map' to associate DC with zone
- Set custom property over VMware DC object. If not already present, add boolean property 'cloudstackzone' with value 'true'. If the property is already present, just set it to 'true'. Now this DC cannot be associated with any other cloudstack zone.
- Dis-associate zone from DC
- Check if all resources (clusters, N1kv etc.) of DC in zone are released, otherwise fail the operation.
- Set custom property over VMware DC object 'cloudstackzone' to 'false'
- AddCluster changes
- No changes for legacy zone.
- All constraint checks would be done while attempting to add cluster to zone. DC information would be retrieved from 'cloud'.'vmware_data_center' table. DC to zone mapping information can be referred from 'cloud'.'zone_vmware_data_center_map'. Constraint checks would be added to VmwareServerDiscoverer.
- Update vmware DC properties in cloud.vmware_data_center table (Say DC name changes in vCenter)
- While adding VMware cluster to zone, check if a DC is already associated with that zone. If not, cluster add operation would fail. To achieve this, check if zone_vmware_data_center_map does have a row for the zone in question. If no such row exists, that means this zone is not yet associated with any DC.
- DeleteCluster changes
- While deleting check if this is last cluster in the zone. If so, dis-association of DC to zone should be done. Hence do following,
- Cleanup tables cloud.zone_dc_map and cloud.vmware_dc for specific zone by removing entries by zone_id (if zone_id in row matches data_center.id then remove the row)
- Set the zone's corresponding DC object's property to 'false'. Now this DC can be associated with any other cloudstack zone.
Database modifications
- 'cloud'.'vmware_data_center' table to track all DC specific information along with details of resources & vCenter
- 'cloud'.'vmware_dc' table to track all DC specific information along with details of resources & vCenter.
- Columns in this table are id, vCenter host/ip, DC name, DC Mor, guid
- id is primary key field of this table
- Implement Dao & VO for this table.
- 'cloud'.'zone_dc_map' table will be added to persist the mapping of zone to DC.
- Columns in this table are id, vmware_dc_id, zone_id
- Foreign key id from vmware_dc table
- Foreign key id from data_center table
- Implement Dao & VO for this table.
- 'cloud'.'cluster_vsm_map' would be removed.
- 'cloud'.'zone_vsm_map' would be added. Also a zone can be associated with more than 1 VSM instances.
- Columns in this table are id, zone_id & vsm_id where id is Primary key of this table.
- Foreign key zone_id from data_center table.
- Foreign key vsm_id from virtual_supervisor_module table.
- Implement Dao & VO classes for this table.
Web Services APIs
- addCluster will be modified
- Interface perspective - Remove parameters vCenter host/ip, username, password and DC name optional based on zone id's presence in zone_dc_map.
- Only required parameter is cluster name.
- associateZoneWithDc -
- Maps a cloudstack zone with specified VMware DC.
- Throws RemoteException if vCenter is not reachable or any other server side Exception caught.
- Upon failure in successful parameter validation throw InvalidParameterValueException
- Parameters are,
- zoneId - required
- dcName - required
- vCenterHost - required
- vCenterUser - required
- vCenterPassword - required
- disAssocaiteZoneWithDc -
- Unmaps a cloudstack zone from a VMWare DC that is associated with it earlier.
- If no association exists already, then throw CloudRuntimeException.
- If no such zone exists, throw InvalidParameterValueException
- If zone is have one or more clusters / elements, then throw ResourceInUseException - Zone should be empty (no clusters or other elements like Nexus 1000v VSM instance)
- Parameter are,
- zoneId - required
UI Flow
- Changes required in UI for live migrating a volume from one storage pool to another.
- Associate zone with DC
- Dis-associate zone with DC
- Support adding zone level entities (NexusVSM etc.) to zone.
- Add Cluster form in zone wizard
- Add Cluster wizard
- Add NexusVSM instance to zone
- Add ASA instance to zone
...
- uuid, DC name, guid, vCenter host, username & password. The 'guid' field encapsulates 'vCenter host/ip' and DC mor. E.g. 'Datacenter:datacenter-101@vcenter.abc.com'
- id is primary key field of this table
- Schema definition
- CREATE TABLE `cloud`.`vmware_data_center` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`uuid` varchar(255) UNIQUE,
`name` varchar(255) NOT NULL COMMENT 'Name of VMware datacenter',
`guid` varchar(255) NOT NULL UNIQUE COMMENT 'String encapsulating VMware datacenter and vCenter',
`vcenter_host` varchar(255) NOT NULL COMMENT 'vCenter host containing this VMware datacenter',
`username` varchar(255) NOT NULL COMMENT 'Name of vCenter host user',
`password` varchar(255) NOT NULL COMMENT 'Password of vCenter host user',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- 'cloud'.'vmware_data_center_zone_map' table will be added to persist the mapping of zone with DC.
- Columns in this table are id, vmware_data_center_id, zone_id
- Foreign key id from vmware_data_center table
- Schema definition
- CREATE TABLE `cloud`.`vmware_data_center_zone_map` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`zone_id` bigint unsigned NOT NULL UNIQUE COMMENT 'id of CloudStack zone',
`vmware_data_center_id` bigint unsigned NOT NULL UNIQUE COMMENT 'id of VMware datacenter',
PRIMARY KEY (`id`),
CONSTRAINT `fk_vmware_data_center_zone_map__vmware_data_center_id` FOREIGN KEY (`vmware_data_center_id`) REFERENCES `vmware_data_center`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- 'cloud'.'legacy_zones' table to track legacy zones in cloudstack deployment. During CloudStack upgrade, this table is populated.
- Columns in this table are id, zone id
- id is primary key field of this table
- Foreign key zone_id refers id from data_center table
- Schema definition
- CREATE TABLE `cloud`.`legacy_zones` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`zone_id` bigint unsigned NOT NULL UNIQUE COMMENT 'id of CloudStack zone',
PRIMARY KEY (`id`),
CONSTRAINT `fk_legacy_zones__zone_id` FOREIGN KEY (`zone_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Web Services APIs
- addCluster will be modified
- Interface perspective -
- No change
- If the zone is legacy, then hide Datacenter/DC text field in UI. Hence cluster url becomes http://vcenterhost/cluster
- addVmwareDc -
- Maps a cloudstack zone with specified VMware DC.
- Throws RemoteException if vCenter is not reachable or any other server side Exception caught.
- Upon failure in parameter validation throw InvalidParameterValueException
- Parameters are,
- zoneId - required
- name - required
- vcenter - required
- username - required
- password - required
- removeVmwareDc -
- Removes and unmaps the VMWare DC that is added to specified zone.
- If no association exists already, then throw CloudRuntimeException.
- If no such zone exists, throw InvalidParameterValueException
- If zone is have one or more clusters / elements, then throw ResourceInUseException - Zone should be empty (no clusters or other elements like Nexus 1000v VSM instance)
- Parameter are,
- zoneId - required
- listVmwareDcs -
- Lists VMware DCs associated with specified zone.
- If no association exists already, then returns empty list
- Parameter is,
- zoneId - required
UI Flow
- Changes required in UI
- Add VMware DC to zone
- Remove VMware DC from zone
- Add Cluster form in zone wizard
- Add Cluster wizard
- Changes to support legacy zones.
Open Issues
- Considering a model where a CloudStack deployment will have some zones with multiple DCs and some zones with single DC. This comes from the fact that existing CloudStack deployment has zones with multiple DCs. But after upgrade to the newest version, customer would like to have existing zones to operate as-is. But all new CloudStack zones would be having single DC. In this model, the existing zone with multiple DCs is termed as Legacy zone and it will not support the zone wide features are requires a zone to have only 1 DC. Also operations on legacy zone should be seamless (like adding a cluster etc.) as they were before upgrade. This means the code base doesn't apply any new logic, that affects the functionality, over legacy zone. For example, constraint checks that happen while adding a cluster to new zone should not be done if the zone is legacy zone.
- New features like zone wide primary storage doesn't go well with zones having multiple hypervisors. How upgrade handled for such zones
...
- Need choose among the options available for migration (Options are listed in Upgrade section below) to upgrade existing cloudstack deployment with multiple DC's without downtime of VMs.
- Whether To go for enhancement of impacted features (Nexus 1000v VSM & ASA1kv instance support). Earlier Nexus 1000v VSM instance is associated with cluster in 1:1 fashion. With new mapping model Nexus 1000v VSM instance can be associated with zone in 1(zone):N(Nexus 1000v VSM). This also opens up the chance to have multiple Nexus VSM instances in single cloudstack zone. Should this be supported as well?
Impact on other areas/features
- Impact of this feature on zone wide primary storage support - vmware.
- Impact of this feature on storage live migration - vmware.
- Cisco Nexus 1000v support needs changes. 1 cluster to 1 Nexus mapping to be removed. Allow Nexus 1000v VSM instance to be associated/dis-associated with zone.
- Impact of this feature on ASA feature needs check.
- Impact of this feature on refactoring in Vmsync.
Upgrade
- on refactoring in Vmsync.
Upgrade
- During CloudStack upgrade operation, Migration support Existing CloudStack Deployments - Existing cloudstack deployments with multiple DC's in a zone
- Decide a DC as the final DC that contains all clusters.
- Move all clusters to the chosen DC.
- For each cluster create cluster with same name in target DC.
Edit the field 'cloud'.'legacy_zones' table is populated. This table will legacy zones in cloudstack deployment.- Migration support
- Existing CloudStack deployments with clusters from multiple DCs/vCenters require consolidation of clusters into single DC.
- Following are options cluster'.'name' in database to reflect new DC name in cluster name.
- Edit the field 'cloud'.'cluster_details'.'url' in database to reflect new DC name in cluster name.
Options to migrate VM across datacenters - Cold migrate each of the instance to this new cluster in chosen DC.
- Hot migrate the VMs by using disconnecting all hosts from source cluster followed by deletion of source cluster from source DC and adding all hosts to cluster in target DC.
- Hot migrate the VMs after suspending the VMs. Need to power on (mean resume) VMs after migration is complete. This needs the virtual disks of VM to be placed on shared storage before triggering the migration operation.
- Pre-requisite checker tool - This tool should go through existing CloudStack deployment and VMware deployment to check if pre-requisites prerequisites are met. Following are list of pre-requisites before going to prerequisites would be convered during upgrade to new version of product with this feature built-in,
- A CloudStack zone should encompass only 1 VMware DC
- The VMware DC encompassed by CloudStack zone should not be shared by multiple CloudStack deployments.
Guidelines of CloudStack version upgrade - Migration would be offline operation before CloudStack version upgrade operation.upgrade operation.
- Prerequisite checker tool would be run as part of CloudStack upgrade
- Choice of migration procedure is above option 1.b.(2ii) - migration of host across DC by disconnecting from cluster in source DC, followed by connecting it to target cluster in another DC. Following are detailed steps,
- Handle the case of clusters from multiple vCenter
- Investigation pendingTo be investigated.
- Handle the case of clusters from single vCenter but different DCs
- Handle the case of deployment using distributed virtual switch (Nexus 1000v or vDS)
- Deploy Nexus 1000v or vDS on target DC with same credentials (user/password)
- Ensure if 'cloud'.'virtual_supervisor_module' table has the new IP of Nexus 1000v VSM instance.
- Create all dvPortgroups required by VMs on the host that is moving across DCs. Make sure all properties of dvPortGroups are in sync, e.g. shaping policy should be same as that of original dvPortGroup in source DC. External switch configuration for trunking/routes is assumed to be taken care of by adminadmin.
- Decide a DC as the final DC that contains all clusters.
- Create a cluster, in target DC, with same properties as that of original cluster
- Unmanage the cluster in CloudStack
- Disconnect each host in source clustertecluster
- Remove each host from source cluster
- Add each host to target cluster
- Create all custom properties
- Each VM will have custom properties like cloud.nic.mask. This will be lost during above migration operations. Hence need to re-create after adding to target cluster
- Each template (user VM and system VM templates) will have custom properties like cloud.uuid. This need to be restored.
- Add the target cluster to CloudStack
- Make sure that guid field of 'cloud'.'host' table has the valid reference because when host is added to target cluster, it will acquire new unique reference.
- Investigation pending for migration of primary/secondary datastore across DCs.
- Pre-requisite checker should run successfully before CloudStack upgrade operation.
- Make sure the field 'cloud'.'cluster'.'name' in database reflect new DC name in cluster name.
- Make sure the field 'cloud'.'cluster_details'.'url' in database reflect new DC name in cluster name
Run CloudStack version upgrade to complete the upgrade- .
Assumptions
- Sharing of resources (datastores, virtual switches like vDS, N1kv and ASA1kv etc.) with other entity (cloudstack or non-cloudstack entity) is not allowed.
- Cloudstack zone doesn't contain multiple hypervisors. A cloudstack zone will have only 1 hypervisor.
Out of scope
- Support zone level Cisco Nexus 1000v VSM instance.
- Support Zone level Cisco ASA 1000v instance.Mapping of Nexus VSM instance with zone