You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server/src/main/java/com/cloud/network/NetworkServiceImpl.java
+31-8Lines changed: 31 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -3090,8 +3090,8 @@ public Network updateGuestNetwork(final UpdateNetworkCmd cmd) {
3090
3090
if (dc.getNetworkType() == NetworkType.Basic) {
3091
3091
thrownewInvalidParameterValueException("Guest VM CIDR can't be specified for zone with " + NetworkType.Basic + " networking");
3092
3092
}
3093
-
if (network.getGuestType() != GuestType.Isolated) {
3094
-
thrownewInvalidParameterValueException("Can only allow IP Reservation in networks with guest type " + GuestType.Isolated);
3093
+
if (network.getGuestType() != GuestType.Isolated && network.getGuestType() != GuestType.Shared) {
3094
+
thrownewInvalidParameterValueException("Can only allow IP Reservation in networks with guest types: " + GuestType.Isolated + " or " + GuestType.Shared);
3095
3095
}
3096
3096
if (networkOfferingChanged) {
3097
3097
thrownewInvalidParameterValueException("Cannot specify this network offering change and guestVmCidr at same time. Specify only one.");
@@ -3111,34 +3111,57 @@ public Network updateGuestNetwork(final UpdateNetworkCmd cmd) {
3111
3111
// But in case networkCidr is a non null value (IP reservation already exists), it implies network cidr is networkCidr
3112
3112
if (networkCidr != null) {
3113
3113
if (!NetUtils.isNetworkAWithinNetworkB(guestVmCidr, networkCidr)) {
3114
-
thrownewInvalidParameterValueException("Invalid value of Guest VM CIDR. For IP Reservation, Guest VM CIDR should be a subset of network CIDR: " + networkCidr);
3114
+
thrownewInvalidParameterValueException("Invalid value of Guest VM CIDR. For IP Reservation, Guest VM CIDR should be a subset of network CIDR: " + networkCidr);
3115
3115
}
3116
3116
} else {
3117
3117
if (!NetUtils.isNetworkAWithinNetworkB(guestVmCidr, network.getCidr())) {
3118
-
thrownewInvalidParameterValueException("Invalid value of Guest VM CIDR. For IP Reservation, Guest VM CIDR should be a subset of network CIDR : " + network.getCidr());
3118
+
thrownewInvalidParameterValueException("Invalid value of Guest VM CIDR. For IP Reservation, Guest VM CIDR should be a subset of network CIDR: " + network.getCidr());
3119
3119
}
3120
3120
}
3121
3121
3122
3122
// This check makes sure there are no active IPs existing outside the guestVmCidr in the network
0 commit comments