mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge branch '4.19' into 4.20
This commit is contained in:
commit
ca62a7dd50
@ -50,6 +50,9 @@ public class SecurityGroupVMMapVO implements InternalIdentity {
|
||||
@Column(name = "ip4_address", table = "nics", insertable = false, updatable = false)
|
||||
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)
|
||||
private State vmState;
|
||||
|
||||
@ -77,6 +80,10 @@ public class SecurityGroupVMMapVO implements InternalIdentity {
|
||||
return guestIpAddress;
|
||||
}
|
||||
|
||||
public String getGuestIpv6Address() {
|
||||
return guestIpv6Address;
|
||||
}
|
||||
|
||||
public long getInstanceId() {
|
||||
return instanceId;
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ public class VmMetricsStatsResponse extends BaseResponse {
|
||||
private String displayName;
|
||||
|
||||
@SerializedName("stats")
|
||||
@Param(description = "the list of VM stats")
|
||||
@Param(description = "the list of VM stats", responseObject = StatsResponse.class)
|
||||
private List<StatsResponse> stats;
|
||||
|
||||
public void setId(String id) {
|
||||
|
||||
@ -355,6 +355,9 @@ public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGro
|
||||
String cidr = defaultNic.getIPv4Address();
|
||||
cidr = cidr + "/32";
|
||||
cidrs.add(cidr);
|
||||
if (defaultNic.getIPv6Address() != null) {
|
||||
cidrs.add(defaultNic.getIPv6Address() + "/64");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (rule.getAllowedSourceIpCidr() != null) {
|
||||
|
||||
@ -249,6 +249,9 @@ public class SecurityGroupManagerImpl2 extends SecurityGroupManagerImpl {
|
||||
//did a join with the nics table
|
||||
String cidr = ngmapVO.getGuestIpAddress() + "/32";
|
||||
cidrs.add(cidr);
|
||||
if (ngmapVO.getGuestIpv6Address() != null) {
|
||||
cidrs.add(ngmapVO.getGuestIpv6Address() + "/64");
|
||||
}
|
||||
}
|
||||
} else if (rule.getAllowedSourceIpCidr() != null) {
|
||||
cidrs.add(rule.getAllowedSourceIpCidr());
|
||||
|
||||
@ -18,13 +18,33 @@
|
||||
|
||||
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" ]
|
||||
then
|
||||
echo "Status: FAULT"
|
||||
exit
|
||||
fi
|
||||
|
||||
ROUTER_TYPE=$(cat /etc/cloudstack/cmdline.json | grep type | awk '{print $2;}' | sed -e 's/[,\"]//g')
|
||||
if [ "$ROUTER_TYPE" = "router" ]
|
||||
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')
|
||||
|
||||
@ -228,7 +228,7 @@ export default {
|
||||
label: 'label.change.offering.for.volume',
|
||||
args: ['id', 'diskofferingid', 'size', 'miniops', 'maxiops', 'automigrate'],
|
||||
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,
|
||||
component: shallowRef(defineAsyncComponent(() => import('@/views/storage/ChangeOfferingForVolume.vue')))
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user