Search in sources :

Example 1 with VmwareDistributedVirtualSwitchPvlanSpec

use of com.vmware.vim25.VmwareDistributedVirtualSwitchPvlanSpec in project cloudstack by apache.

the class HypervisorHostHelper method isDVSPortConfigSame.

private static boolean isDVSPortConfigSame(String dvPortGroupName, VMwareDVSPortSetting currentPortSetting, VMwareDVSPortSetting newPortSetting, boolean dvSwitchSupportNewPolicies) {
    if (areDVSSecurityPoliciesDifferent(currentPortSetting.getSecurityPolicy(), newPortSetting.getSecurityPolicy())) {
        return false;
    }
    if (dvSwitchSupportNewPolicies && areDVSMacManagementPoliciesDifferent(currentPortSetting.getMacManagementPolicy(), newPortSetting.getMacManagementPolicy())) {
        return false;
    }
    VmwareDistributedVirtualSwitchVlanSpec oldVlanSpec = currentPortSetting.getVlan();
    VmwareDistributedVirtualSwitchVlanSpec newVlanSpec = newPortSetting.getVlan();
    int oldVlanId, newVlanId;
    if (oldVlanSpec instanceof VmwareDistributedVirtualSwitchPvlanSpec && newVlanSpec instanceof VmwareDistributedVirtualSwitchPvlanSpec) {
        VmwareDistributedVirtualSwitchPvlanSpec oldpVlanSpec = (VmwareDistributedVirtualSwitchPvlanSpec) oldVlanSpec;
        VmwareDistributedVirtualSwitchPvlanSpec newpVlanSpec = (VmwareDistributedVirtualSwitchPvlanSpec) newVlanSpec;
        oldVlanId = oldpVlanSpec.getPvlanId();
        newVlanId = newpVlanSpec.getPvlanId();
    } else if (oldVlanSpec instanceof VmwareDistributedVirtualSwitchTrunkVlanSpec && newVlanSpec instanceof VmwareDistributedVirtualSwitchTrunkVlanSpec) {
        VmwareDistributedVirtualSwitchTrunkVlanSpec oldpVlanSpec = (VmwareDistributedVirtualSwitchTrunkVlanSpec) oldVlanSpec;
        VmwareDistributedVirtualSwitchTrunkVlanSpec newpVlanSpec = (VmwareDistributedVirtualSwitchTrunkVlanSpec) newVlanSpec;
        oldVlanId = oldpVlanSpec.getVlanId().get(0).getStart();
        newVlanId = newpVlanSpec.getVlanId().get(0).getStart();
    } else if (oldVlanSpec instanceof VmwareDistributedVirtualSwitchVlanIdSpec && newVlanSpec instanceof VmwareDistributedVirtualSwitchVlanIdSpec) {
        VmwareDistributedVirtualSwitchVlanIdSpec oldVlanIdSpec = (VmwareDistributedVirtualSwitchVlanIdSpec) oldVlanSpec;
        VmwareDistributedVirtualSwitchVlanIdSpec newVlanIdSpec = (VmwareDistributedVirtualSwitchVlanIdSpec) newVlanSpec;
        oldVlanId = oldVlanIdSpec.getVlanId();
        newVlanId = newVlanIdSpec.getVlanId();
    } else {
        s_logger.debug(String.format("Old and new vlan spec type mismatch found for dvPortGroup: %s. Old spec type is: %s, and new spec type is: %s", dvPortGroupName, oldVlanSpec.getClass(), newVlanSpec.getClass()));
        return false;
    }
    if (oldVlanId != newVlanId) {
        s_logger.info(String.format("Detected that new VLAN [%d] is different from current VLAN [%d] of dvPortGroup: %s", newVlanId, oldVlanId, dvPortGroupName));
        return false;
    }
    return true;
}
Also used : VmwareDistributedVirtualSwitchTrunkVlanSpec(com.vmware.vim25.VmwareDistributedVirtualSwitchTrunkVlanSpec) VmwareDistributedVirtualSwitchPvlanSpec(com.vmware.vim25.VmwareDistributedVirtualSwitchPvlanSpec) VmwareDistributedVirtualSwitchVlanSpec(com.vmware.vim25.VmwareDistributedVirtualSwitchVlanSpec) VmwareDistributedVirtualSwitchVlanIdSpec(com.vmware.vim25.VmwareDistributedVirtualSwitchVlanIdSpec)

Example 2 with VmwareDistributedVirtualSwitchPvlanSpec

use of com.vmware.vim25.VmwareDistributedVirtualSwitchPvlanSpec in project cloudstack by apache.

the class HypervisorHostHelper method createPortGroup.

private static void createPortGroup(String physicalNetwork, String networkName, Integer vid, Integer spvlanid, DatacenterMO dataCenterMo, DVSTrafficShapingPolicy shapingPolicy, DVSSecurityPolicy secPolicy, VMwareDVSPortgroupPolicy portGroupPolicy, DistributedVirtualSwitchMO dvSwitchMo, int numPorts, boolean autoExpandSupported) throws Exception {
    VmwareDistributedVirtualSwitchVlanSpec vlanSpec = null;
    VmwareDistributedVirtualSwitchPvlanSpec pvlanSpec = null;
    VMwareDVSPortSetting dvsPortSetting = null;
    DVPortgroupConfigSpec newDvPortGroupSpec;
    // NOTE - VmwareDistributedVirtualSwitchPvlanSpec extends VmwareDistributedVirtualSwitchVlanSpec.
    if (vid == null || spvlanid == null) {
        vlanSpec = createDVPortVlanIdSpec(vid);
        dvsPortSetting = createVmwareDVPortSettingSpec(shapingPolicy, secPolicy, vlanSpec);
    } else if (spvlanid != null) {
        // Create a pvlan spec. The pvlan spec is different from the pvlan config spec
        // that we created earlier. The pvlan config spec is used to configure the switch
        // with a <primary vlanId, secondary vlanId> tuple. The pvlan spec is used
        // to configure a port group (i.e., a network) with a secondary vlan id. We don't
        // need to mention more than the secondary vlan id because one secondary vlan id
        // can be associated with only one primary vlan id. Give vCenter the secondary vlan id,
        // and it will find out the associated primary vlan id and do the rest of the
        // port group configuration.
        pvlanSpec = createDVPortPvlanIdSpec(spvlanid);
        dvsPortSetting = createVmwareDVPortSettingSpec(shapingPolicy, secPolicy, pvlanSpec);
    }
    newDvPortGroupSpec = createDvPortGroupSpec(networkName, dvsPortSetting, numPorts, autoExpandSupported);
    if (portGroupPolicy != null) {
        newDvPortGroupSpec.setPolicy(portGroupPolicy);
    }
    if (!dataCenterMo.hasDvPortGroup(networkName)) {
        s_logger.info("Distributed Virtual Port group " + networkName + " not found.");
        // TODO(sateesh): Handle Exceptions
        try {
            dvSwitchMo.createDVPortGroup(newDvPortGroupSpec);
        } catch (Exception e) {
            String msg = "Failed to create distributed virtual port group " + networkName + " on dvSwitch " + physicalNetwork;
            msg += ". " + VmwareHelper.getExceptionMessage(e);
            throw new Exception(msg);
        }
    } else {
        s_logger.info("Found Distributed Virtual Port group " + networkName);
        DVPortgroupConfigInfo currentDvPortgroupInfo = dataCenterMo.getDvPortGroupSpec(networkName);
        if (!isSpecMatch(currentDvPortgroupInfo, newDvPortGroupSpec)) {
            s_logger.info("Updating Distributed Virtual Port group " + networkName);
            newDvPortGroupSpec.setDefaultPortConfig(dvsPortSetting);
            newDvPortGroupSpec.setConfigVersion(currentDvPortgroupInfo.getConfigVersion());
            ManagedObjectReference morDvPortGroup = dataCenterMo.getDvPortGroupMor(networkName);
            try {
                dvSwitchMo.updateDvPortGroup(morDvPortGroup, newDvPortGroupSpec);
            } catch (Exception e) {
                String msg = "Failed to update distributed virtual port group " + networkName + " on dvSwitch " + physicalNetwork;
                msg += ". " + VmwareHelper.getExceptionMessage(e);
                throw new Exception(msg);
            }
        }
    }
}
Also used : VMwareDVSPortSetting(com.vmware.vim25.VMwareDVSPortSetting) VmwareDistributedVirtualSwitchPvlanSpec(com.vmware.vim25.VmwareDistributedVirtualSwitchPvlanSpec) VmwareDistributedVirtualSwitchVlanSpec(com.vmware.vim25.VmwareDistributedVirtualSwitchVlanSpec) DVPortgroupConfigSpec(com.vmware.vim25.DVPortgroupConfigSpec) URISyntaxException(java.net.URISyntaxException) InvalidParameterException(java.security.InvalidParameterException) CloudException(com.cloud.exception.CloudException) SAXException(org.xml.sax.SAXException) TransformerException(javax.xml.transform.TransformerException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) IOException(java.io.IOException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) DVPortgroupConfigInfo(com.vmware.vim25.DVPortgroupConfigInfo) ManagedObjectReference(com.vmware.vim25.ManagedObjectReference)

Example 3 with VmwareDistributedVirtualSwitchPvlanSpec

use of com.vmware.vim25.VmwareDistributedVirtualSwitchPvlanSpec in project cloudstack by apache.

the class VmwareResource method getUnmanageInstanceNics.

private List<UnmanagedInstanceTO.Nic> getUnmanageInstanceNics(VmwareHypervisorHost hyperHost, VirtualMachineMO vmMo) {
    List<UnmanagedInstanceTO.Nic> instanceNics = new ArrayList<>();
    HashMap<String, List<String>> guestNicMacIPAddressMap = new HashMap<>();
    try {
        GuestInfo guestInfo = vmMo.getGuestInfo();
        if (guestInfo.getToolsStatus() == VirtualMachineToolsStatus.TOOLS_OK) {
            for (GuestNicInfo nicInfo : guestInfo.getNet()) {
                if (CollectionUtils.isNotEmpty(nicInfo.getIpAddress())) {
                    List<String> ipAddresses = new ArrayList<>();
                    for (String ipAddress : nicInfo.getIpAddress()) {
                        if (NetUtils.isValidIp4(ipAddress)) {
                            ipAddresses.add(ipAddress);
                        }
                    }
                    guestNicMacIPAddressMap.put(nicInfo.getMacAddress(), ipAddresses);
                }
            }
        } else {
            s_logger.info(String.format("Unable to retrieve guest nics for instance: %s from VMware tools as tools status: %s", vmMo.getName(), guestInfo.getToolsStatus().toString()));
        }
    } catch (Exception e) {
        s_logger.info("Unable to retrieve guest nics for instance from VMware tools. " + e.getMessage());
    }
    VirtualDevice[] nics = null;
    try {
        nics = vmMo.getNicDevices();
    } catch (Exception e) {
        s_logger.info("Unable to retrieve unmanaged instance nics. " + e.getMessage());
    }
    if (nics != null) {
        for (VirtualDevice nic : nics) {
            try {
                VirtualEthernetCard ethCardDevice = (VirtualEthernetCard) nic;
                s_logger.error(nic.getClass().getCanonicalName() + " " + nic.getBacking().getClass().getCanonicalName() + " " + ethCardDevice.getMacAddress());
                UnmanagedInstanceTO.Nic instanceNic = new UnmanagedInstanceTO.Nic();
                instanceNic.setNicId(ethCardDevice.getDeviceInfo().getLabel());
                if (ethCardDevice instanceof VirtualPCNet32) {
                    instanceNic.setAdapterType(VirtualEthernetCardType.PCNet32.toString());
                } else if (ethCardDevice instanceof VirtualVmxnet2) {
                    instanceNic.setAdapterType(VirtualEthernetCardType.Vmxnet2.toString());
                } else if (ethCardDevice instanceof VirtualVmxnet3) {
                    instanceNic.setAdapterType(VirtualEthernetCardType.Vmxnet3.toString());
                } else {
                    instanceNic.setAdapterType(VirtualEthernetCardType.E1000.toString());
                }
                instanceNic.setMacAddress(ethCardDevice.getMacAddress());
                if (guestNicMacIPAddressMap.containsKey(instanceNic.getMacAddress())) {
                    instanceNic.setIpAddress(guestNicMacIPAddressMap.get(instanceNic.getMacAddress()));
                }
                if (ethCardDevice.getSlotInfo() != null) {
                    instanceNic.setPciSlot(ethCardDevice.getSlotInfo().toString());
                }
                VirtualDeviceBackingInfo backing = ethCardDevice.getBacking();
                if (backing instanceof VirtualEthernetCardDistributedVirtualPortBackingInfo) {
                    VirtualEthernetCardDistributedVirtualPortBackingInfo backingInfo = (VirtualEthernetCardDistributedVirtualPortBackingInfo) backing;
                    DistributedVirtualSwitchPortConnection port = backingInfo.getPort();
                    String portKey = port.getPortKey();
                    String portGroupKey = port.getPortgroupKey();
                    String dvSwitchUuid = port.getSwitchUuid();
                    s_logger.debug("NIC " + nic.toString() + " is connected to dvSwitch " + dvSwitchUuid + " pg " + portGroupKey + " port " + portKey);
                    ManagedObjectReference dvSwitchManager = vmMo.getContext().getVimClient().getServiceContent().getDvSwitchManager();
                    ManagedObjectReference dvSwitch = vmMo.getContext().getVimClient().getService().queryDvsByUuid(dvSwitchManager, dvSwitchUuid);
                    // Get all ports
                    DistributedVirtualSwitchPortCriteria criteria = new DistributedVirtualSwitchPortCriteria();
                    criteria.setInside(true);
                    criteria.getPortgroupKey().add(portGroupKey);
                    List<DistributedVirtualPort> dvPorts = vmMo.getContext().getVimClient().getService().fetchDVPorts(dvSwitch, criteria);
                    for (DistributedVirtualPort dvPort : dvPorts) {
                        // Find the port for this NIC by portkey
                        if (portKey.equals(dvPort.getKey())) {
                            VMwareDVSPortSetting settings = (VMwareDVSPortSetting) dvPort.getConfig().getSetting();
                            if (settings.getVlan() instanceof VmwareDistributedVirtualSwitchVlanIdSpec) {
                                VmwareDistributedVirtualSwitchVlanIdSpec vlanId = (VmwareDistributedVirtualSwitchVlanIdSpec) settings.getVlan();
                                s_logger.trace("Found port " + dvPort.getKey() + " with vlan " + vlanId.getVlanId());
                                if (vlanId.getVlanId() > 0 && vlanId.getVlanId() < 4095) {
                                    instanceNic.setVlan(vlanId.getVlanId());
                                }
                            } else if (settings.getVlan() instanceof VmwareDistributedVirtualSwitchPvlanSpec) {
                                VmwareDistributedVirtualSwitchPvlanSpec pvlanSpec = (VmwareDistributedVirtualSwitchPvlanSpec) settings.getVlan();
                                s_logger.trace("Found port " + dvPort.getKey() + " with pvlan " + pvlanSpec.getPvlanId());
                                if (pvlanSpec.getPvlanId() > 0 && pvlanSpec.getPvlanId() < 4095) {
                                    DistributedVirtualSwitchMO dvSwitchMo = new DistributedVirtualSwitchMO(vmMo.getContext(), dvSwitch);
                                    Pair<Integer, HypervisorHostHelper.PvlanType> vlanDetails = dvSwitchMo.retrieveVlanFromPvlan(pvlanSpec.getPvlanId(), dvSwitch);
                                    if (vlanDetails != null && vlanDetails.first() != null && vlanDetails.second() != null) {
                                        instanceNic.setVlan(vlanDetails.first());
                                        instanceNic.setPvlan(pvlanSpec.getPvlanId());
                                        instanceNic.setPvlanType(vlanDetails.second().toString());
                                    }
                                }
                            }
                            break;
                        }
                    }
                } else if (backing instanceof VirtualEthernetCardNetworkBackingInfo) {
                    VirtualEthernetCardNetworkBackingInfo backingInfo = (VirtualEthernetCardNetworkBackingInfo) backing;
                    instanceNic.setNetwork(backingInfo.getDeviceName());
                    if (hyperHost instanceof HostMO) {
                        HostMO hostMo = (HostMO) hyperHost;
                        HostPortGroupSpec portGroupSpec = hostMo.getHostPortGroupSpec(backingInfo.getDeviceName());
                        instanceNic.setVlan(portGroupSpec.getVlanId());
                    }
                }
                instanceNics.add(instanceNic);
            } catch (Exception e) {
                s_logger.info("Unable to retrieve unmanaged instance nic info. " + e.getMessage());
            }
        }
        Collections.sort(instanceNics, new Comparator<UnmanagedInstanceTO.Nic>() {

            @Override
            public int compare(final UnmanagedInstanceTO.Nic nic1, final UnmanagedInstanceTO.Nic nic2) {
                return extractInt(nic1) - extractInt(nic2);
            }

            int extractInt(UnmanagedInstanceTO.Nic nic) {
                String num = nic.getNicId().replaceAll("\\D", "");
                // return 0 if no digits found
                return num.isEmpty() ? 0 : Integer.parseInt(num);
            }
        });
    }
    return instanceNics;
}
Also used : VMwareDVSPortSetting(com.vmware.vim25.VMwareDVSPortSetting) VirtualEthernetCardDistributedVirtualPortBackingInfo(com.vmware.vim25.VirtualEthernetCardDistributedVirtualPortBackingInfo) VirtualEthernetCardNetworkBackingInfo(com.vmware.vim25.VirtualEthernetCardNetworkBackingInfo) HashMap(java.util.HashMap) VirtualPCNet32(com.vmware.vim25.VirtualPCNet32) HostMO(com.cloud.hypervisor.vmware.mo.HostMO) ArrayList(java.util.ArrayList) VirtualVmxnet2(com.vmware.vim25.VirtualVmxnet2) HostPortGroupSpec(com.vmware.vim25.HostPortGroupSpec) VirtualVmxnet3(com.vmware.vim25.VirtualVmxnet3) DistributedVirtualSwitchPortConnection(com.vmware.vim25.DistributedVirtualSwitchPortConnection) GuestNicInfo(com.vmware.vim25.GuestNicInfo) DistributedVirtualSwitchMO(com.cloud.hypervisor.vmware.mo.DistributedVirtualSwitchMO) UnmanagedInstanceTO(org.apache.cloudstack.vm.UnmanagedInstanceTO) HypervisorHostHelper(com.cloud.hypervisor.vmware.mo.HypervisorHostHelper) DistributedVirtualSwitchPortCriteria(com.vmware.vim25.DistributedVirtualSwitchPortCriteria) ArrayList(java.util.ArrayList) List(java.util.List) VmwareDistributedVirtualSwitchPvlanSpec(com.vmware.vim25.VmwareDistributedVirtualSwitchPvlanSpec) VirtualEthernetCard(com.vmware.vim25.VirtualEthernetCard) VmwareDistributedVirtualSwitchVlanIdSpec(com.vmware.vim25.VmwareDistributedVirtualSwitchVlanIdSpec) Pair(com.cloud.utils.Pair) DistributedVirtualPort(com.vmware.vim25.DistributedVirtualPort) VirtualDevice(com.vmware.vim25.VirtualDevice) VirtualDeviceBackingInfo(com.vmware.vim25.VirtualDeviceBackingInfo) ConnectException(java.net.ConnectException) IOException(java.io.IOException) RemoteException(java.rmi.RemoteException) InternalErrorException(com.cloud.exception.InternalErrorException) CloudException(com.cloud.exception.CloudException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) ConfigurationException(javax.naming.ConfigurationException) GuestInfo(com.vmware.vim25.GuestInfo) ManagedObjectReference(com.vmware.vim25.ManagedObjectReference)

Example 4 with VmwareDistributedVirtualSwitchPvlanSpec

use of com.vmware.vim25.VmwareDistributedVirtualSwitchPvlanSpec in project cloudstack by apache.

the class HypervisorHostHelper method createPortGroup.

private static void createPortGroup(String physicalNetwork, String networkName, String vlanRange, Integer vid, Integer spvlanid, DatacenterMO dataCenterMo, DVSTrafficShapingPolicy shapingPolicy, DVSSecurityPolicy secPolicy, DVSMacManagementPolicy macManagementPolicy, VMwareDVSPortgroupPolicy portGroupPolicy, DistributedVirtualSwitchMO dvSwitchMo, int numPorts, boolean autoExpandSupported, boolean dvSwitchSupportNewPolicies) throws Exception {
    VmwareDistributedVirtualSwitchVlanSpec vlanSpec = null;
    VmwareDistributedVirtualSwitchPvlanSpec pvlanSpec = null;
    VMwareDVSPortSetting dvsPortSetting = null;
    DVPortgroupConfigSpec newDvPortGroupSpec;
    // NOTE - VmwareDistributedVirtualSwitchPvlanSpec extends VmwareDistributedVirtualSwitchVlanSpec.
    if (vid == null || spvlanid == null) {
        vlanSpec = createDVPortVlanSpec(vid, vlanRange);
        dvsPortSetting = createVmwareDVPortSettingSpec(shapingPolicy, secPolicy, macManagementPolicy, vlanSpec, dvSwitchSupportNewPolicies);
    } else if (spvlanid != null) {
        // Create a pvlan spec. The pvlan spec is different from the pvlan config spec
        // that we created earlier. The pvlan config spec is used to configure the switch
        // with a <primary vlanId, secondary vlanId> tuple. The pvlan spec is used
        // to configure a port group (i.e., a network) with a secondary vlan id. We don't
        // need to mention more than the secondary vlan id because one secondary vlan id
        // can be associated with only one primary vlan id. Give vCenter the secondary vlan id,
        // and it will find out the associated primary vlan id and do the rest of the
        // port group configuration.
        pvlanSpec = createDVPortPvlanIdSpec(spvlanid);
        dvsPortSetting = createVmwareDVPortSettingSpec(shapingPolicy, secPolicy, macManagementPolicy, pvlanSpec, dvSwitchSupportNewPolicies);
    }
    newDvPortGroupSpec = createDvPortGroupSpec(networkName, dvsPortSetting, autoExpandSupported);
    if (portGroupPolicy != null) {
        newDvPortGroupSpec.setPolicy(portGroupPolicy);
    }
    if (!dataCenterMo.hasDvPortGroup(networkName)) {
        s_logger.info("Distributed Virtual Port group " + networkName + " not found.");
        // TODO(sateesh): Handle Exceptions
        try {
            newDvPortGroupSpec.setNumPorts(numPorts);
            dvSwitchMo.createDVPortGroup(newDvPortGroupSpec);
        } catch (Exception e) {
            String msg = "Failed to create distributed virtual port group " + networkName + " on dvSwitch " + physicalNetwork;
            msg += ". " + VmwareHelper.getExceptionMessage(e);
            throw new Exception(msg);
        }
    } else {
        s_logger.info("Found Distributed Virtual Port group " + networkName);
        DVPortgroupConfigInfo currentDvPortgroupInfo = dataCenterMo.getDvPortGroupSpec(networkName);
        if (!isSpecMatch(currentDvPortgroupInfo, newDvPortGroupSpec, dvSwitchSupportNewPolicies)) {
            s_logger.info("Updating Distributed Virtual Port group " + networkName);
            newDvPortGroupSpec.setDefaultPortConfig(dvsPortSetting);
            newDvPortGroupSpec.setConfigVersion(currentDvPortgroupInfo.getConfigVersion());
            ManagedObjectReference morDvPortGroup = dataCenterMo.getDvPortGroupMor(networkName);
            try {
                dvSwitchMo.updateDvPortGroup(morDvPortGroup, newDvPortGroupSpec);
            } catch (Exception e) {
                String msg = "Failed to update distributed virtual port group " + networkName + " on dvSwitch " + physicalNetwork;
                msg += ". " + VmwareHelper.getExceptionMessage(e);
                throw new Exception(msg);
            }
        }
    }
}
Also used : VMwareDVSPortSetting(com.vmware.vim25.VMwareDVSPortSetting) VmwareDistributedVirtualSwitchPvlanSpec(com.vmware.vim25.VmwareDistributedVirtualSwitchPvlanSpec) VmwareDistributedVirtualSwitchVlanSpec(com.vmware.vim25.VmwareDistributedVirtualSwitchVlanSpec) DVPortgroupConfigSpec(com.vmware.vim25.DVPortgroupConfigSpec) InvalidParameterException(java.security.InvalidParameterException) CloudException(com.cloud.exception.CloudException) TransformerException(javax.xml.transform.TransformerException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) IOException(java.io.IOException) URISyntaxException(java.net.URISyntaxException) SAXException(org.xml.sax.SAXException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) DVPortgroupConfigInfo(com.vmware.vim25.DVPortgroupConfigInfo) ManagedObjectReference(com.vmware.vim25.ManagedObjectReference)

Example 5 with VmwareDistributedVirtualSwitchPvlanSpec

use of com.vmware.vim25.VmwareDistributedVirtualSwitchPvlanSpec in project cloudstack by apache.

the class HypervisorHostHelper method createDVPortPvlanIdSpec.

public static VmwareDistributedVirtualSwitchPvlanSpec createDVPortPvlanIdSpec(int pvlanId) {
    VmwareDistributedVirtualSwitchPvlanSpec pvlanIdSpec = new VmwareDistributedVirtualSwitchPvlanSpec();
    pvlanIdSpec.setPvlanId(pvlanId);
    return pvlanIdSpec;
}
Also used : VmwareDistributedVirtualSwitchPvlanSpec(com.vmware.vim25.VmwareDistributedVirtualSwitchPvlanSpec)

Aggregations

VmwareDistributedVirtualSwitchPvlanSpec (com.vmware.vim25.VmwareDistributedVirtualSwitchPvlanSpec)5 CloudException (com.cloud.exception.CloudException)3 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)3 ManagedObjectReference (com.vmware.vim25.ManagedObjectReference)3 VMwareDVSPortSetting (com.vmware.vim25.VMwareDVSPortSetting)3 VmwareDistributedVirtualSwitchVlanSpec (com.vmware.vim25.VmwareDistributedVirtualSwitchVlanSpec)3 IOException (java.io.IOException)3 DVPortgroupConfigInfo (com.vmware.vim25.DVPortgroupConfigInfo)2 DVPortgroupConfigSpec (com.vmware.vim25.DVPortgroupConfigSpec)2 VmwareDistributedVirtualSwitchVlanIdSpec (com.vmware.vim25.VmwareDistributedVirtualSwitchVlanIdSpec)2 URISyntaxException (java.net.URISyntaxException)2 InvalidParameterException (java.security.InvalidParameterException)2 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)2 TransformerException (javax.xml.transform.TransformerException)2 SAXException (org.xml.sax.SAXException)2 InternalErrorException (com.cloud.exception.InternalErrorException)1 DistributedVirtualSwitchMO (com.cloud.hypervisor.vmware.mo.DistributedVirtualSwitchMO)1 HostMO (com.cloud.hypervisor.vmware.mo.HostMO)1 HypervisorHostHelper (com.cloud.hypervisor.vmware.mo.HypervisorHostHelper)1 Pair (com.cloud.utils.Pair)1