Package com.vmware.vim25.mo

Examples of com.vmware.vim25.mo.HostSystem


    String hostname = "sjin-dev1.eng.vmware.com";
    String portGroupName = "ViMaster PortGroup";
    String switchName = "ViMaster Switch";

    Folder rootFolder = si.getRootFolder();
    HostSystem host = null;
    host = (HostSystem) new InventoryNavigator(
        rootFolder).searchManagedEntity("HostSystem", hostname);

    HostNetworkSystem hns = host.getHostNetworkSystem();

    // add a virtual switch
    HostVirtualSwitchSpec spec = new HostVirtualSwitchSpec();
    spec.setNumPorts(8);
    hns.addVirtualSwitch(switchName, spec);
View Full Code Here


    ServiceInstance si = new ServiceInstance(
        new URL(args[0]), args[1], args[2], true);

    String hostname = args[3];
    Folder rootFolder = si.getRootFolder();
    HostSystem host = null;
    host = (HostSystem) new InventoryNavigator(
        rootFolder).searchManagedEntity("HostSystem", hostname);

    if(host==null)
    {
      System.out.println("Cannot find the host:" + hostname);
      si.getServerConnection().logout();
      return;
    }
    HostSnmpSystem hss = host.getHostSnmpSystem();
   
    HostSnmpConfigSpec spec = new HostSnmpConfigSpec();
    spec.setEnabled(true);
    spec.setReadOnlyCommunities(new String[] {"visdk"});
    HostSnmpDestination dest = new HostSnmpDestination();
View Full Code Here

   
    String hostname = "10.20.143.205";
    String datastorePath = "[storage1 (2)]";

    Folder rootFolder = si.getRootFolder();
    HostSystem host = null;

    host = (HostSystem) new InventoryNavigator(
        rootFolder).searchManagedEntity("HostSystem", hostname);

    if(host==null)
    {
      System.out.println("Host not found");
      si.getServerConnection().logout();
      return;
    }
   
    HostDatastoreBrowser hdb = host.getDatastoreBrowser();
 
    System.out.println("print out the names of the datastores");
    Datastore[] ds = hdb.getDatastores();
    for(int i=0; ds!=null && i<ds.length; i++)
    {
View Full Code Here

    ServiceInstance si = new ServiceInstance(
        new URL(args[0]), args[1], args[2], true);

    String hostname = "sjin-dev1.eng.vmware.com";
    Folder rootFolder = si.getRootFolder();
    HostSystem host = null;
    host = (HostSystem) new InventoryNavigator(
        rootFolder).searchManagedEntity("HostSystem", hostname);

    if(host==null)
    {
      System.out.println("Cannot find the host:" + hostname);
      si.getServerConnection().logout();
      return;
    }
   
    HostServiceSystem hss = host.getHostServiceSystem();
   
    HostServiceInfo hsi = hss.getServiceInfo();
    HostService[] ss = hsi.getService();
    for(int i=0; ss!=null && i<ss.length; i++)
    {
View Full Code Here

    Folder rootFolder = si.getRootFolder();
    VirtualMachine vm = (VirtualMachine) new InventoryNavigator(
        rootFolder).searchManagedEntity(
            "VirtualMachine", vmname);
    HostSystem newHost = (HostSystem) new InventoryNavigator(
        rootFolder).searchManagedEntity(
            "HostSystem", newHostName);
    ComputeResource cr = (ComputeResource) newHost.getParent();
   
    String[] checks = new String[] {"cpu", "software"};
    HostVMotionCompatibility[] vmcs =
      si.queryVMotionCompatibility(vm, new HostSystem[]
         {newHost},checks );
View Full Code Here

    {
      System.out.println("No Datastore found");
      return null;
    }
   
    ConfigTarget configTarget = envBrowser.queryConfigTarget(new HostSystem(vm.getServerConnection(), hmor));
    VirtualMachineDatastoreInfo[] dis = configTarget.getDatastore();
    for (int i=0; dis!=null && i<dis.length; i++)
    {
      dsSum = dis[i].getDatastore();
      if (dsSum.isAccessible() && dsName.equals(dsSum.getName()))
View Full Code Here

  throws Exception
  {
    VirtualMachineRuntimeInfo vmRuntimeInfo = vm.getRuntime();
    EnvironmentBrowser envBrowser = vm.getEnvironmentBrowser();
    ManagedObjectReference hmor = vmRuntimeInfo.getHost();
    VirtualMachineConfigOption cfgOpt = envBrowser.queryConfigOption(null, new HostSystem(vm.getServerConnection(), hmor));
    VirtualDevice[] defaultDevs = null;
    if (cfgOpt != null)
    {
      defaultDevs = cfgOpt.getDefaultDevice();
      if (defaultDevs == null)
View Full Code Here

  {
    VirtualMachineRuntimeInfo vmRuntimeInfo = vm.getRuntime();
    EnvironmentBrowser envBrowser = vm.getEnvironmentBrowser();
    ManagedObjectReference hmor = vmRuntimeInfo.getHost();

    HostSystem host = new HostSystem(
        vm.getServerConnection(), hmor);
    ConfigTarget cfg = envBrowser.queryConfigTarget(host);
    VirtualMachineNetworkInfo[] nets = cfg.getNetwork();
    for (int i = 0; nets!=null && i < nets.length; i++)
    {
View Full Code Here

      (powerState == VirtualMachinePowerState.suspended && vmVer < 7))
    {
      throw new InvalidPowerState();
    }
   
    HostSystem host = new HostSystem(vm.getServerConnection(), vm.getRuntime().getHost());
    ComputeResource cr = (ComputeResource) host.getParent();
    EnvironmentBrowser envBrowser = cr.getEnvironmentBrowser();
    ConfigTarget configTarget = envBrowser.queryConfigTarget(host);
    VirtualMachineConfigOption vmCfgOpt = envBrowser.queryConfigOption(null, host);

    type = validateNicType(vmCfgOpt.getGuestOSDescriptor(), vm.getConfig().getGuestId(), type);
View Full Code Here

            }
            // Get instance UUID
            String instanceUuid = vmConfigInfo.getInstanceUuid();
            // Get host information
            ManagedObjectReference hmor = vmRuntimeInfo.getHost();
            HostSystem host = new HostSystem(
                vm.getServerConnection(), hmor);
            String hostName = host.getName();
            // Get Contrail VRouter virtual machine information from the host
            String vrouterIpAddress = getVirtualMachineIpAddress(dvPgName,
                    hostName, host, contrailVRouterVmNamePrefix);
            if (vrouterIpAddress == null) {
                s_logger.error("dvPg: " + dvPgName + " vm: " + vmName +
View Full Code Here

TOP

Related Classes of com.vmware.vim25.mo.HostSystem

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.