mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-9475: Attaching to PVLAN on VMware dvSwtich fails on VR reboot
handle casting VmwareDistributedVirtualSwitchVlanSpec, to appropriate class corresponding to vlan and pvlan. For pvvlan cast to VmwareDistributedVirtualSwitchPvlanSpec for vlan cast to VmwareDistributedVirtualSwitchVlanIdSpec
This commit is contained in:
parent
63fe32e78f
commit
2cc3efbdd1
|
|
@ -833,12 +833,21 @@ public class HypervisorHostHelper {
|
|||
}
|
||||
}
|
||||
|
||||
VmwareDistributedVirtualSwitchVlanIdSpec oldVlanSpec = (VmwareDistributedVirtualSwitchVlanIdSpec)((
|
||||
VMwareDVSPortSetting)currentDvPortgroupInfo.getDefaultPortConfig()).getVlan();
|
||||
VmwareDistributedVirtualSwitchVlanIdSpec newVlanSpec = (VmwareDistributedVirtualSwitchVlanIdSpec)((
|
||||
VMwareDVSPortSetting)newDvPortGroupSpec.getDefaultPortConfig()).getVlan();
|
||||
int oldVlanId = oldVlanSpec.getVlanId();
|
||||
int newVlanId = newVlanSpec.getVlanId();
|
||||
int oldVlanId, newVlanId;
|
||||
VmwareDistributedVirtualSwitchVlanSpec oldVlanSpec = (VmwareDistributedVirtualSwitchVlanSpec)((VMwareDVSPortSetting)currentDvPortgroupInfo.getDefaultPortConfig()).getVlan();
|
||||
VmwareDistributedVirtualSwitchVlanSpec newVlanSpec = (VmwareDistributedVirtualSwitchVlanSpec)((VMwareDVSPortSetting)newDvPortGroupSpec.getDefaultPortConfig()).getVlan();
|
||||
if (oldVlanSpec instanceof VmwareDistributedVirtualSwitchPvlanSpec && newVlanSpec instanceof VmwareDistributedVirtualSwitchPvlanSpec) {
|
||||
VmwareDistributedVirtualSwitchPvlanSpec oldpVlanSpec = (VmwareDistributedVirtualSwitchPvlanSpec) oldVlanSpec;
|
||||
VmwareDistributedVirtualSwitchPvlanSpec newpVlanSpec = (VmwareDistributedVirtualSwitchPvlanSpec) newVlanSpec;
|
||||
oldVlanId = oldpVlanSpec.getPvlanId();
|
||||
newVlanId = newpVlanSpec.getPvlanId();
|
||||
} else {
|
||||
VmwareDistributedVirtualSwitchVlanIdSpec oldVlanIdSpec = (VmwareDistributedVirtualSwitchVlanIdSpec) oldVlanSpec;
|
||||
VmwareDistributedVirtualSwitchVlanIdSpec newVlanIdSpec = (VmwareDistributedVirtualSwitchVlanIdSpec) newVlanSpec;
|
||||
oldVlanId = oldVlanIdSpec.getVlanId();
|
||||
newVlanId = newVlanIdSpec.getVlanId();
|
||||
}
|
||||
|
||||
if (oldVlanId != newVlanId) {
|
||||
s_logger.info("Detected that new VLAN [" + newVlanId + "] of dvPortGroup [" + dvPortGroupName +
|
||||
"] is different from current VLAN [" + oldVlanId + "]");
|
||||
|
|
|
|||
Loading…
Reference in New Issue