Merge branch '4.19' into 4.20

This commit is contained in:
Suresh Kumar Anaparti 2025-08-29 15:31:00 +05:30
commit ca62a7dd50
No known key found for this signature in database
GPG Key ID: D7CEAE3A9E71D0AA
6 changed files with 36 additions and 3 deletions

View File

@ -50,6 +50,9 @@ public class SecurityGroupVMMapVO implements InternalIdentity {
@Column(name = "ip4_address", table = "nics", insertable = false, updatable = false) @Column(name = "ip4_address", table = "nics", insertable = false, updatable = false)
private String guestIpAddress; private String guestIpAddress;
@Column(name = "ip6_address", table = "nics", insertable = false, updatable = false)
private String guestIpv6Address;
@Column(name = "state", table = "vm_instance", insertable = false, updatable = false) @Column(name = "state", table = "vm_instance", insertable = false, updatable = false)
private State vmState; private State vmState;
@ -77,6 +80,10 @@ public class SecurityGroupVMMapVO implements InternalIdentity {
return guestIpAddress; return guestIpAddress;
} }
public String getGuestIpv6Address() {
return guestIpv6Address;
}
public long getInstanceId() { public long getInstanceId() {
return instanceId; return instanceId;
} }

View File

@ -40,7 +40,7 @@ public class VmMetricsStatsResponse extends BaseResponse {
private String displayName; private String displayName;
@SerializedName("stats") @SerializedName("stats")
@Param(description = "the list of VM stats") @Param(description = "the list of VM stats", responseObject = StatsResponse.class)
private List<StatsResponse> stats; private List<StatsResponse> stats;
public void setId(String id) { public void setId(String id) {

View File

@ -355,6 +355,9 @@ public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGro
String cidr = defaultNic.getIPv4Address(); String cidr = defaultNic.getIPv4Address();
cidr = cidr + "/32"; cidr = cidr + "/32";
cidrs.add(cidr); cidrs.add(cidr);
if (defaultNic.getIPv6Address() != null) {
cidrs.add(defaultNic.getIPv6Address() + "/64");
}
} }
} }
} else if (rule.getAllowedSourceIpCidr() != null) { } else if (rule.getAllowedSourceIpCidr() != null) {

View File

@ -249,6 +249,9 @@ public class SecurityGroupManagerImpl2 extends SecurityGroupManagerImpl {
//did a join with the nics table //did a join with the nics table
String cidr = ngmapVO.getGuestIpAddress() + "/32"; String cidr = ngmapVO.getGuestIpAddress() + "/32";
cidrs.add(cidr); cidrs.add(cidr);
if (ngmapVO.getGuestIpv6Address() != null) {
cidrs.add(ngmapVO.getGuestIpv6Address() + "/64");
}
} }
} else if (rule.getAllowedSourceIpCidr() != null) { } else if (rule.getAllowedSourceIpCidr() != null) {
cidrs.add(rule.getAllowedSourceIpCidr()); cidrs.add(rule.getAllowedSourceIpCidr());

View File

@ -18,13 +18,33 @@
STATUS=UNKNOWN STATUS=UNKNOWN
get_guest_nics() {
python3 -c "
import json
data = json.load(open('/etc/cloudstack/ips.json'))
for nic, objs in data.items():
if isinstance(objs, list):
for obj in objs:
if obj.get('nw_type') == 'guest' and obj.get('add'):
print(nic)
"
}
ROUTER_TYPE=$(cat /etc/cloudstack/cmdline.json | grep type | awk '{print $2;}' | sed -e 's/[,\"]//g')
if [ "$ROUTER_TYPE" = "vpcrouter" ];then
GUEST_NICS=$(get_guest_nics)
if [ "$GUEST_NICS" = "" ];then
echo "Status: ${STATUS}"
exit
fi
fi
if [ "$(systemctl is-active keepalived)" != "active" ] if [ "$(systemctl is-active keepalived)" != "active" ]
then then
echo "Status: FAULT" echo "Status: FAULT"
exit exit
fi fi
ROUTER_TYPE=$(cat /etc/cloudstack/cmdline.json | grep type | awk '{print $2;}' | sed -e 's/[,\"]//g')
if [ "$ROUTER_TYPE" = "router" ] if [ "$ROUTER_TYPE" = "router" ]
then then
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') 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')

View File

@ -228,7 +228,7 @@ export default {
label: 'label.change.offering.for.volume', label: 'label.change.offering.for.volume',
args: ['id', 'diskofferingid', 'size', 'miniops', 'maxiops', 'automigrate'], args: ['id', 'diskofferingid', 'size', 'miniops', 'maxiops', 'automigrate'],
dataView: true, dataView: true,
show: (record, store) => { return ['Allocated', 'Ready'].includes(record.state) && ['Admin'].includes(store.userInfo.roletype) }, show: (record, store) => { return ['Allocated', 'Ready'].includes(record.state) },
popup: true, popup: true,
component: shallowRef(defineAsyncComponent(() => import('@/views/storage/ChangeOfferingForVolume.vue'))) component: shallowRef(defineAsyncComponent(() => import('@/views/storage/ChangeOfferingForVolume.vue')))
}, },