Package com.vmware.vim25

Examples of com.vmware.vim25.HostConnectSpec


            String host, String userName, String password) throws Exception {

        VmwareClient vclient = serviceContext.getVimClient();
        ManagedObjectReference morHost = vclient.getDecendentMoRef(morCluster, "HostSystem", host);
        if(morHost == null) {
            HostConnectSpec hostSpec = new HostConnectSpec();
            hostSpec.setUserName(userName);
            hostSpec.setPassword(password);
            hostSpec.setHostName(host);
            hostSpec.setForce(true);        // forcely take over the host

            ManagedObjectReference morTask = serviceContext.getService().addHostTask(morCluster, hostSpec, true, null, null);
            boolean taskResult = vclient.waitForTask(morTask);
            if(!taskResult) {
                s_logger.error("Unable to add host " + host + " to vSphere cluster due to " + TaskMO.getTaskFailureInfo(serviceContext, morTask));
View Full Code Here


            String host, String userName, String password) throws Exception {

        ServiceUtil serviceUtil = serviceContext.getServiceUtil();
        ManagedObjectReference morHost = serviceUtil.getDecendentMoRef(morCluster, "HostSystem", host);
        if(morHost == null) {
            HostConnectSpec hostSpec = new HostConnectSpec();
            hostSpec.setUserName(userName);
            hostSpec.setPassword(password);
            hostSpec.setHostName(host);
            hostSpec.setForce(true);    // forcely take over the host

            ManagedObjectReference morTask = serviceContext.getService().addHost_Task(morCluster, hostSpec, true, null, null);
            String taskResult = serviceUtil.waitForTask(morTask);
            if(!taskResult.equals("sucess")) {
                s_logger.error("Unable to add host " + host + " to vSphere cluster due to " + TaskMO.getTaskFailureInfo(serviceContext, morTask));
View Full Code Here

            String host, String userName, String password) throws Exception {

        VmwareClient vclient = serviceContext.getVimClient();
        ManagedObjectReference morHost = vclient.getDecendentMoRef(morCluster, "HostSystem", host);
        if(morHost == null) {
            HostConnectSpec hostSpec = new HostConnectSpec();
            hostSpec.setUserName(userName);
            hostSpec.setPassword(password);
            hostSpec.setHostName(host);
            hostSpec.setForce(true);    // forcely take over the host

            ManagedObjectReference morTask = serviceContext.getService().addHostTask(morCluster, hostSpec, true, null, null);
            boolean taskResult = vclient.waitForTask(morTask);
            if(!taskResult) {
                s_logger.error("Unable to add host " + host + " to vSphere cluster due to " + TaskMO.getTaskFailureInfo(serviceContext, morTask));
View Full Code Here

            String host, String userName, String password) throws Exception {

        ServiceUtil serviceUtil = serviceContext.getServiceUtil();
        ManagedObjectReference morHost = serviceUtil.getDecendentMoRef(morCluster, "HostSystem", host);
        if(morHost == null) {
            HostConnectSpec hostSpec = new HostConnectSpec();
            hostSpec.setUserName(userName);
            hostSpec.setPassword(password);
            hostSpec.setHostName(host);
            hostSpec.setForce(true);    // forcely take over the host

            ManagedObjectReference morTask = serviceContext.getService().addHost_Task(morCluster, hostSpec, true, null, null);
            String taskResult = serviceUtil.waitForTask(morTask);
            if(!taskResult.equals("sucess")) {
                s_logger.error("Unable to add host " + host + " to vSphere cluster due to " + TaskMO.getTaskFailureInfo(serviceContext, morTask));
View Full Code Here

            String host, String userName, String password) throws Exception {

        VmwareClient vclient = serviceContext.getVimClient();
        ManagedObjectReference morHost = vclient.getDecendentMoRef(morCluster, "HostSystem", host);
        if(morHost == null) {
            HostConnectSpec hostSpec = new HostConnectSpec();
            hostSpec.setUserName(userName);
            hostSpec.setPassword(password);
            hostSpec.setHostName(host);
            hostSpec.setForce(true);    // forcely take over the host

            ManagedObjectReference morTask = serviceContext.getService().addHostTask(morCluster, hostSpec, true, null, null);
            boolean taskResult = vclient.waitForTask(morTask);
            if(!taskResult) {
                s_logger.error("Unable to add host " + host + " to vSphere cluster due to " + TaskMO.getTaskFailureInfo(serviceContext, morTask));
View Full Code Here

        }

        String morefOfNewVm = null;
       
        /* wait nfc lease */
        HttpNfcLeaseState hls;
    while (true) {
      hls = httpNfcLease.getState();
      if (hls == HttpNfcLeaseState.ready ||
                hls == HttpNfcLeaseState.error) { break; }
    }
View Full Code Here

                return node.getSnapshot();
            } else {
                VirtualMachineSnapshotTree[] childTree =
                    node.getChildSnapshotList();
                if (childTree != null) {
                    ManagedObjectReference mor =
                        findSnapshotInTree(childTree, snapName);
                    if (mor != null) { return mor; }
                }
            }
        }
View Full Code Here

       
        VirtualMachineSnapshotTree[] snapTree =
            vm_.getSnapshot().getRootSnapshotList();
       
        if (snapTree != null) {
            ManagedObjectReference mor = findSnapshotInTree(snapTree, snapName);
            if (mor != null) {
                return new
                    VirtualMachineSnapshot(vm_.getServerConnection(), mor);
            }
        }
View Full Code Here

        if (entityType == null || morefStr == null) {
            return null;
        }

        /* create managed object reference */
        ManagedObjectReference mor = new ManagedObjectReference();
        mor.setType(entityType);
        mor.setVal(morefStr);

        return mor;
    }
View Full Code Here

     */
    protected VirtualMachine generateVirtualMachineWithMoref(String morefStr)
    {
        if (si_ == null || morefStr == null) { return null; }

        ManagedObjectReference mor =
            generateMoref("VirtualMachine", morefStr);
        if (mor == null) { return null; }

        ManagedEntity vm =
            MorUtil.createExactManagedEntity(si_.getServerConnection(), mor);
View Full Code Here

TOP

Related Classes of com.vmware.vim25.HostConnectSpec

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.