Package com.vmware.vim25

Examples of com.vmware.vim25.VirtualEthernetCard


        int nicIndex = allocPublicNicIndex(vmMo);

        try {
            VirtualDevice[] nicDevices = vmMo.getNicDevices();

            VirtualEthernetCard device = (VirtualEthernetCard) nicDevices[nicIndex];

            if (VirtualSwitchType.StandardVirtualSwitch == vSwitchType) {
                VirtualEthernetCardNetworkBackingInfo nicBacking = new VirtualEthernetCardNetworkBackingInfo();
                nicBacking.setDeviceName(networkInfo.second());
                nicBacking.setNetwork(networkInfo.first());
                device.setBacking(nicBacking);
            } else {
                HostMO hostMo = vmMo.getRunningHost();
                DatacenterMO dataCenterMo = new DatacenterMO(hostMo.getContext(), hostMo.getHyperHostDatacenter());
                device.setBacking(dataCenterMo.getDvPortBackingInfo(networkInfo));
            }

            VirtualMachineConfigSpec vmConfigSpec = new VirtualMachineConfigSpec();

            //VirtualDeviceConfigSpec[] deviceConfigSpecArray = new VirtualDeviceConfigSpec[1];
View Full Code Here


 
  private static VirtualDeviceConfigSpec createNicSpec(VirtualNetworkAdapterType adapterType, String macAddress, boolean wakeOnLan, boolean startConnected, VirtualDeviceBackingInfo nicBacking)
  {
    VirtualDeviceConfigSpec result = new VirtualDeviceConfigSpec();

    VirtualEthernetCard device;
    switch (adapterType)
    {
      case VirtualVmxnet:
        device = new VirtualVmxnet();
        break;
View Full Code Here

    //  http://communities.vmware.com/message/1251528
    VirtualDeviceConfigSpec nicSpec =
      new VirtualDeviceConfigSpec();
    nicSpec.setOperation(VirtualDeviceConfigSpecOperation.add);

    VirtualEthernetCard nic=null;
   
    if (nicAdapter.equals("e1000")) {
      nic= new VirtualE1000();
    }
    if (nicAdapter.equals("pcnet32")) {
      nic= new VirtualPCNet32();
    }
    if (nicAdapter.equals("vmxnet2")) {
      nic= new VirtualVmxnet2();
    }
    if (nicAdapter.equals("vmxnet3")) {
      nic= new VirtualVmxnet3();
    }
   
    if (nic==null) {
      throw new Exception("unknown nic adaptor type: use e1000, pcnet32, vmxnet2, vmxnet3 ");
    }
     
   
    nic.setConnectable(new VirtualDeviceConnectInfo());
    nic.connectable.setStartConnected(startConnected);
    nic.connectable.setConnected(connected);

    VirtualEthernetCardNetworkBackingInfo nicBacking =
      new VirtualEthernetCardNetworkBackingInfo();
    nicBacking.setDeviceName(nicNetwork);

    Description info = new Description();
    info.setLabel(nicName);
    info.setSummary(nicNetwork);
    nic.setDeviceInfo(info);

    // type: "generated", "manual", "assigned" by VC
    nic.setAddressType("generated");
    nic.setBacking(nicBacking);
    nic.setKey(0);

    nicSpec.setDevice(nic);
    return nicSpec;
      }
View Full Code Here

    for(int i=0;i<devices.length;i++)
    {

      if (devices[i] instanceof VirtualEthernetCard) {

        VirtualEthernetCard newnic=null;
        newnic=(VirtualEthernetCard) devices[i];

        String aName=devices[i].getDeviceInfo().getLabel();
       
        if (aName.toLowerCase().equals(nicName.toLowerCase())) {
         
          return(newnic.getMacAddress());
         
        }

      }
    }
View Full Code Here

    for(int i=0;i<devices.length;i++)
    {

      if (devices[i] instanceof VirtualEthernetCard) {

        VirtualEthernetCard newnic=null;
        newnic=(VirtualEthernetCard) devices[i];
       
        System.out.println(newnic.getMacAddress());
        System.out.println("network device");
        System.out.println(devices[i].getDeviceInfo().getLabel());
        System.out.println(devices[i].getDeviceInfo().getSummary());

        if (devices[i] instanceof VirtualE1000) {
View Full Code Here

        VirtualDeviceConfigSpec nicSpec =
            new VirtualDeviceConfigSpec();
        nicSpec.setOperation(VirtualDeviceConfigSpecOperation.add);

        VirtualEthernetCard nic =  new VirtualE1000();
        VirtualEthernetCardNetworkBackingInfo nicBacking =
            new VirtualEthernetCardNetworkBackingInfo();
        nicBacking.setDeviceName(netName);

        Description info = new Description();
        info.setLabel(nicName);
        info.setSummary(netName);
        nic.setDeviceInfo(info);
View Full Code Here

        boolean isScsi = true;
       
        switch(type_) {
        case IDE:
            isScsi = false;
            ctrl = new VirtualIDEController();
            break;
        case BUSLOGIC:
            isScsi = true;
            ctrl = new VirtualBusLogicController();
            break;
View Full Code Here

    private VirtualDeviceConfigSpec createScsiSpec(int cKey)
    {
        VirtualDeviceConfigSpec scsiSpec =
            new VirtualDeviceConfigSpec();
        scsiSpec.setOperation(VirtualDeviceConfigSpecOperation.add);
        VirtualLsiLogicController scsiCtrl =
            new VirtualLsiLogicController();
        scsiCtrl.setKey(cKey);
        scsiCtrl.setBusNumber(0);
        scsiCtrl.setSharedBus(VirtualSCSISharing.noSharing);
        scsiSpec.setDevice(scsiCtrl);
        return scsiSpec;
    }
View Full Code Here

            isScsi = true;
            ctrl = new VirtualBusLogicController();
            break;
        case LSILOGIC:
            isScsi = true;
            ctrl = new VirtualLsiLogicController();
            break;
        case LSILOGICSAS:
            isScsi = true;
            ctrl = new VirtualLsiLogicSASController();
            break;
View Full Code Here

            isScsi = true;
            ctrl = new VirtualLsiLogicController();
            break;
        case LSILOGICSAS:
            isScsi = true;
            ctrl = new VirtualLsiLogicSASController();
            break;
        default:
            return null;
        }
View Full Code Here

TOP

Related Classes of com.vmware.vim25.VirtualEthernetCard

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.