...
- 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.
- 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 new creation of new zone
Hypervisor support
...
- 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 DC is not under the CloudStack zone, also an ASA1kv instance cannot be added to a Vmware cluster if its DC is not in the zone. The model itself will not limit how many Vmware clusters that a N1kv VSM instance or ASA1kv or vDS will manage, as long as N1kv or ASA1kv or vDS and its managed cluster are within the same DC.
- CloudStack should be able to add/manage following DC level resources in scope of zone.
- Clusters
- Datastores for zone wide storage
- 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_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 deployment.
- Check custom property over VMware's DC object if this DC is already associated with a zone of a 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 etc.) in 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 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_center table (guid).If zone is disabled, no operations are allowed over that zone. Ex:- Add/remove cluster.
- 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.
...
- 'cloud'.'vmware_data_center' table to track all DC specific information along with details of resources & vCenter.
- Columns in this table are id, uuid, DC name, guid, vCenter host, username & password. The 'guid' field encapsulates 'vCenter host/ip' and DC mor. E.g. 'vcenterDatacenter:datacenter-101@vcenter.abc.com@dc-101com'
- 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 'id Name of CloudStack zoneVMware datacenter',
`guid` varchar(255) NOT NULL UNIQUE COMMENT 'id of 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'.'zone_vmware_data_center_zone_map' table will be added to persist the mapping of zone to with DC.
- Columns in this table are id, vmware_dcdata_center_id, zone_id
- Foreign key id from vmware_dc table
- Foreign key id from data_center table
- Foreign key zone_id from data_center table.
- Schema definition
- CREATE TABLE `cloud`.`zone_vmware`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_zone_vmware_data_center_map__zone_id` FOREIGN KEY (`zone_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE,
CONSTRAINT `fk_zone_vmware_data_center_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_zone_vmware_data_center_maplegacy_zones__zone_id` FOREIGN KEY (`zone_id`) REFERENCES `data_center`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
...
- 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.
- No change
- If the zone is legacy, then hide Datacenter/DC text field in UI. Hence cluster url becomes http://vcenterhost/cluster
- addVmwareDc 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 name - required
- vCenterHost vcenter - required
- vCenterUser username - required
- vCenterPassword password - required
- disAssocaiteZoneWithDc removeVmwareDc -
- Unmaps a cloudstack zone from a Removes and unmaps the VMWare DC that is associated with it earlieradded 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)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 isParameter are,
- zoneId - required
UI Flow
- Changes required in UI
- Associate zone with DC
- Add VMware DC to zone
- Remove VMware DC from zone
Dis-associate zone with DC- 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 new 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?
Impact on other areas/features
...
{"serverDuration": 190, "requestCorrelationId": "1066b44764b6e946"}