Skip to content

Commit ca62a7d

Browse files
Merge branch '4.19' into 4.20
2 parents 0f0155c + 3109e00 commit ca62a7d

File tree

6 files changed

+36
-3
lines changed

6 files changed

+36
-3
lines changed

engine/schema/src/main/java/com/cloud/network/security/SecurityGroupVMMapVO.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public class SecurityGroupVMMapVO implements InternalIdentity {
5050
@Column(name = "ip4_address", table = "nics", insertable = false, updatable = false)
5151
private String guestIpAddress;
5252

53+
@Column(name = "ip6_address", table = "nics", insertable = false, updatable = false)
54+
private String guestIpv6Address;
55+
5356
@Column(name = "state", table = "vm_instance", insertable = false, updatable = false)
5457
private State vmState;
5558

@@ -77,6 +80,10 @@ public String getGuestIpAddress() {
7780
return guestIpAddress;
7881
}
7982

83+
public String getGuestIpv6Address() {
84+
return guestIpv6Address;
85+
}
86+
8087
public long getInstanceId() {
8188
return instanceId;
8289
}

plugins/metrics/src/main/java/org/apache/cloudstack/response/VmMetricsStatsResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class VmMetricsStatsResponse extends BaseResponse {
4040
private String displayName;
4141

4242
@SerializedName("stats")
43-
@Param(description = "the list of VM stats")
43+
@Param(description = "the list of VM stats", responseObject = StatsResponse.class)
4444
private List<StatsResponse> stats;
4545

4646
public void setId(String id) {

server/src/main/java/com/cloud/network/security/SecurityGroupManagerImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ protected Map<PortAndProto, Set<String>> generateRulesForVM(Long userVmId, Secur
355355
String cidr = defaultNic.getIPv4Address();
356356
cidr = cidr + "/32";
357357
cidrs.add(cidr);
358+
if (defaultNic.getIPv6Address() != null) {
359+
cidrs.add(defaultNic.getIPv6Address() + "/64");
360+
}
358361
}
359362
}
360363
} else if (rule.getAllowedSourceIpCidr() != null) {

server/src/main/java/com/cloud/network/security/SecurityGroupManagerImpl2.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ protected Map<PortAndProto, Set<String>> generateRulesForVM(Long userVmId, Secur
249249
//did a join with the nics table
250250
String cidr = ngmapVO.getGuestIpAddress() + "/32";
251251
cidrs.add(cidr);
252+
if (ngmapVO.getGuestIpv6Address() != null) {
253+
cidrs.add(ngmapVO.getGuestIpv6Address() + "/64");
254+
}
252255
}
253256
} else if (rule.getAllowedSourceIpCidr() != null) {
254257
cidrs.add(rule.getAllowedSourceIpCidr());

systemvm/debian/opt/cloud/bin/checkrouter.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,33 @@
1818

1919
STATUS=UNKNOWN
2020

21+
get_guest_nics() {
22+
python3 -c "
23+
import json
24+
data = json.load(open('/etc/cloudstack/ips.json'))
25+
for nic, objs in data.items():
26+
if isinstance(objs, list):
27+
for obj in objs:
28+
if obj.get('nw_type') == 'guest' and obj.get('add'):
29+
print(nic)
30+
"
31+
}
32+
33+
ROUTER_TYPE=$(cat /etc/cloudstack/cmdline.json | grep type | awk '{print $2;}' | sed -e 's/[,\"]//g')
34+
if [ "$ROUTER_TYPE" = "vpcrouter" ];then
35+
GUEST_NICS=$(get_guest_nics)
36+
if [ "$GUEST_NICS" = "" ];then
37+
echo "Status: ${STATUS}"
38+
exit
39+
fi
40+
fi
41+
2142
if [ "$(systemctl is-active keepalived)" != "active" ]
2243
then
2344
echo "Status: FAULT"
2445
exit
2546
fi
2647

27-
ROUTER_TYPE=$(cat /etc/cloudstack/cmdline.json | grep type | awk '{print $2;}' | sed -e 's/[,\"]//g')
2848
if [ "$ROUTER_TYPE" = "router" ]
2949
then
3050
ROUTER_STATE=$(ip -4 addr show dev eth0 | grep inet | wc -l | xargs bash -c 'if [ $0 == 2 ]; then echo "PRIMARY"; else echo "BACKUP"; fi')

ui/src/config/section/storage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export default {
228228
label: 'label.change.offering.for.volume',
229229
args: ['id', 'diskofferingid', 'size', 'miniops', 'maxiops', 'automigrate'],
230230
dataView: true,
231-
show: (record, store) => { return ['Allocated', 'Ready'].includes(record.state) && ['Admin'].includes(store.userInfo.roletype) },
231+
show: (record, store) => { return ['Allocated', 'Ready'].includes(record.state) },
232232
popup: true,
233233
component: shallowRef(defineAsyncComponent(() => import('@/views/storage/ChangeOfferingForVolume.vue')))
234234
},

0 commit comments

Comments
 (0)