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
+55-11Lines changed: 55 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -3090,15 +3090,18 @@ 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.");
3098
3098
}
3099
-
if (network.getState() != Network.State.Implemented && network.getState() != Network.State.Allocated) {
3100
-
thrownewInvalidParameterValueException(String.format("The network must be in %s or %s state. IP Reservation cannot be applied in %s state",
if (network.getGuestType() != GuestType.Isolated && network.getGuestType() != GuestType.Shared) {
3100
+
thrownewInvalidParameterValueException("Can only allow IP Reservation in networks with guest types: " + GuestType.Isolated + " or " + GuestType.Shared);
thrownewInvalidParameterValueException("Invalid format of Guest VM CIDR.");
@@ -3111,34 +3114,57 @@ public Network updateGuestNetwork(final UpdateNetworkCmd cmd) {
3111
3114
// But in case networkCidr is a non null value (IP reservation already exists), it implies network cidr is networkCidr
3112
3115
if (networkCidr != null) {
3113
3116
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);
3117
+
thrownewInvalidParameterValueException("Invalid value of Guest VM CIDR. For IP Reservation, Guest VM CIDR should be a subset of network CIDR: " + networkCidr);
3115
3118
}
3116
3119
} else {
3117
3120
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());
3121
+
thrownewInvalidParameterValueException("Invalid value of Guest VM CIDR. For IP Reservation, Guest VM CIDR should be a subset of network CIDR: " + network.getCidr());
3119
3122
}
3120
3123
}
3121
3124
3122
3125
// This check makes sure there are no active IPs existing outside the guestVmCidr in the network
0 commit comments