DVPortConfigInfo dvPortConfigInfo = vmDvPort.getConfig();
VMwareDVSPortSetting settings = (VMwareDVSPortSetting)dvPortConfigInfo.getSetting();
VmwareDistributedVirtualSwitchVlanIdSpec vlanId = (VmwareDistributedVirtualSwitchVlanIdSpec)settings.getVlan();
BoolPolicy blocked = settings.getBlocked();
if (blocked.isValue() == Boolean.TRUE) {
s_logger.trace("Port is blocked, set a vlanid and unblock");
DVPortConfigSpec dvPortConfigSpec = new DVPortConfigSpec();
VMwareDVSPortSetting edittedSettings = new VMwareDVSPortSetting();
// Unblock
blocked.setValue(Boolean.FALSE);
blocked.setInherited(Boolean.FALSE);
edittedSettings.setBlocked(blocked);
// Set vlan
int i;
for (i = 1; i < 4095; i++) {
if (!usedVlans.contains(i))