mirror of https://github.com/apache/cloudstack.git
engine: fix network with SG disabled still has security group script adding rules on KVM (#5049)
This PR fixes #5047 which can be reproduced on Zones with _(I) Advanced Networks, (II) Security Groups enabled for the Zone, (III) network offering without Security Groups_; for instance, `DefaultSharedNetworkOffering` which does not list Security Group as supported service.
The issue is due to the following code inside the method `VirtualMachineManagerImpl.orchestrateReboot`:
[VirtualMachineManagerImpl.java#L3340](280c13a4bb/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java (L3340)).
```
final Answer rebootAnswer = cmds.getAnswer(RebootAnswer.class);
if (rebootAnswer != null && rebootAnswer.getResult()) {
if (dc.isSecurityGroupEnabled() && vm.getType() == VirtualMachine.Type.User) {
List<Long> affectedVms = new ArrayList<Long>();
affectedVms.add(vm.getId());
_securityGroupManager.scheduleRulesetUpdateToHosts(affectedVms, true, null);
}
return;
}
```
This commit is contained in:
parent
e2183ed666
commit
a78f676037
|
|
@ -3182,7 +3182,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||
|
||||
final Answer rebootAnswer = cmds.getAnswer(RebootAnswer.class);
|
||||
if (rebootAnswer != null && rebootAnswer.getResult()) {
|
||||
if (dc.isSecurityGroupEnabled() && vm.getType() == VirtualMachine.Type.User) {
|
||||
boolean isVmSecurityGroupEnabled = _securityGroupManager.isVmSecurityGroupEnabled(vm.getId());
|
||||
if (isVmSecurityGroupEnabled && vm.getType() == VirtualMachine.Type.User) {
|
||||
List<Long> affectedVms = new ArrayList<Long>();
|
||||
affectedVms.add(vm.getId());
|
||||
_securityGroupManager.scheduleRulesetUpdateToHosts(affectedVms, true, null);
|
||||
|
|
|
|||
Loading…
Reference in New Issue