Skip to content

Commit 431ea49

Browse files
author
Prachi Damle
committed
CLOUDSTACK-4302: Instance wizard UI: Support affinity groups for dedicated zones
Changes: - Add affinityGroupUuid in the listzones response for dedicatedZones.
1 parent cb609d2 commit 431ea49

4 files changed

Lines changed: 57 additions & 0 deletions

File tree

‎api/src/org/apache/cloudstack/api/response/ZoneResponse.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ public class ZoneResponse extends BaseResponse {
9999
@SerializedName(ApiConstants.LOCAL_STORAGE_ENABLED) @Param(description="true if local storage offering enabled, false otherwise")
100100
private boolean localStorageEnabled;
101101

102+
@SerializedName(ApiConstants.AFFINITY_GROUP_ID)
103+
@Param(description = "the UUID of the affinity group associated, null for public zones")
104+
private String affinityGroupId;
105+
102106
public void setId(String id) {
103107
this.id = id;
104108
}
@@ -198,4 +202,8 @@ public String getIp6Dns2() {
198202
public void setIp6Dns2(String ip6Dns2) {
199203
this.ip6Dns2 = ip6Dns2;
200204
}
205+
206+
public void setAffinityGroupId(String affinityGroupId) {
207+
this.affinityGroupId = affinityGroupId;
208+
}
201209
}

‎server/src/com/cloud/api/query/dao/DataCenterJoinDaoImpl.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ public ZoneResponse newDataCenterResponse(DataCenterJoinVO dataCenter, Boolean s
9494
zoneResponse.setAllocationState(dataCenter.getAllocationState().toString());
9595
zoneResponse.setZoneToken(dataCenter.getZoneToken());
9696
zoneResponse.setDhcpProvider(dataCenter.getDhcpProvider());
97+
zoneResponse.setAffinityGroupId(dataCenter.getAffinityGroupUuid());
9798
zoneResponse.setObjectName("zone");
9899
return zoneResponse;
99100
}

‎server/src/com/cloud/api/query/vo/DataCenterJoinVO.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ public class DataCenterJoinVO extends BaseViewVO implements InternalIdentity, Id
108108
@Column(name="domain_path")
109109
private String domainPath;
110110

111+
@Column(name = "affinity_group_id")
112+
private long affinityGroupId;
113+
114+
@Column(name = "affinity_group_uuid")
115+
private String affinityGroupUuid;
116+
111117

112118
public DataCenterJoinVO() {
113119
}
@@ -302,5 +308,11 @@ public void setIp6Dns2(String ip6Dns2) {
302308
this.ip6Dns2 = ip6Dns2;
303309
}
304310

311+
public long getAffinityGroupId() {
312+
return affinityGroupId;
313+
}
305314

315+
public String getAffinityGroupUuid() {
316+
return affinityGroupUuid;
317+
}
306318
}

‎setup/db/db/schema-412to420.sql‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2321,3 +2321,39 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'manage
23212321
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'management-server', 'storage.cache.replacement.enabled', 'true', 'enable or disable cache storage replacement algorithm.');
23222322
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Storage', 'DEFAULT', 'management-server', 'storage.cache.replacement.interval', '86400', 'time interval between cache replacement threads (in seconds).');
23232323

2324+
DROP VIEW IF EXISTS `cloud`.`data_center_view`;
2325+
CREATE VIEW `cloud`.`data_center_view` AS
2326+
select
2327+
data_center.id,
2328+
data_center.uuid,
2329+
data_center.name,
2330+
data_center.is_security_group_enabled,
2331+
data_center.is_local_storage_enabled,
2332+
data_center.description,
2333+
data_center.dns1,
2334+
data_center.dns2,
2335+
data_center.ip6_dns1,
2336+
data_center.ip6_dns2,
2337+
data_center.internal_dns1,
2338+
data_center.internal_dns2,
2339+
data_center.guest_network_cidr,
2340+
data_center.domain,
2341+
data_center.networktype,
2342+
data_center.allocation_state,
2343+
data_center.zone_token,
2344+
data_center.dhcp_provider,
2345+
data_center.removed,
2346+
domain.id domain_id,
2347+
domain.uuid domain_uuid,
2348+
domain.name domain_name,
2349+
domain.path domain_path,
2350+
dedicated_resources.affinity_group_id,
2351+
affinity_group.uuid affinity_group_uuid
2352+
from
2353+
`cloud`.`data_center`
2354+
left join
2355+
`cloud`.`domain` ON data_center.domain_id = domain.id
2356+
left join
2357+
`cloud`.`dedicated_resources` ON data_center.id = dedicated_resources.data_center_id
2358+
left join
2359+
`cloud`.`affinity_group` ON dedicated_resources.affinity_group_id = affinity_group.id;

0 commit comments

Comments
 (0)