Examples of VmwareClient


Examples of com.cloud.hypervisor.vmware.util.VmwareClient

    String serviceUrl = "https://" + vCenterAddress + "/sdk/vimService";
    if(s_logger.isDebugEnabled())
      s_logger.debug("initialize VmwareContext. url: " + serviceUrl + ", username: " + vCenterUserName + ", password: " + StringUtils.getMaskedPasswordForDisplay(vCenterPassword));

    VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++);
    vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword);

    VmwareContext context = new VmwareContext(vimClient, vCenterAddress);
    context.registerStockObject(VmwareManager.CONTEXT_STOCK_NAME, s_vmwareMgr);

    context.registerStockObject("serviceconsole", s_vmwareMgr.getServiceConsolePortGroupName());
View Full Code Here

Examples of com.cloud.hypervisor.vmware.util.VmwareClient

    String serviceUrl = "https://" + vCenterAddress + "/sdk/vimService";

    if(s_logger.isDebugEnabled())
      s_logger.debug("initialize VmwareContext. url: " + serviceUrl + ", username: " + vCenterUserName + ", password: " + StringUtils.getMaskedPasswordForDisplay(vCenterPassword));

    VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++);
    vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword);

    VmwareContext context = new VmwareContext(vimClient, vCenterAddress);
    return context;
  }
View Full Code Here

Examples of com.cloud.hypervisor.vmware.util.VmwareClient

    @Deprecated
    private ManagedObjectReference addHostToVCenterCluster(VmwareContext serviceContext, ManagedObjectReference morCluster,
            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));
                throw new CloudRuntimeException("Unable to add host " + host + " to vSphere cluster due to " + taskResult);
            }
            serviceContext.waitForTaskProgressDone(morTask);

            // init morHost after it has been created
            morHost = vclient.getDecendentMoRef(morCluster, "HostSystem", host);
            if(morHost == null) {
                throw new CloudRuntimeException("Successfully added host into vSphere but unable to find it later on?!. Please make sure you are either using IP address or full qualified domain name for host");
            }
        }
View Full Code Here

Examples of com.cloud.hypervisor.vmware.util.VmwareClient

    assert(vCenterAddress != null);
    assert(vCenterUserName != null);
    assert(vCenterPassword != null);

    String serviceUrl = "https://" + vCenterAddress + "/sdk/vimService";
    VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++);
    vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword);
    VmwareContext context = new VmwareContext(vimClient, vCenterAddress);
    assert(context != null);
   
    context.setPoolInfo(s_pool, VmwareContextPool.composePoolKey(vCenterAddress, vCenterUserName));
    s_pool.registerOutstandingContext(context);
View Full Code Here

Examples of com.cloud.hypervisor.vmware.util.VmwareClient

    @Deprecated
    private ManagedObjectReference addHostToVCenterCluster(VmwareContext serviceContext, ManagedObjectReference morCluster,
            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));
                throw new CloudRuntimeException("Unable to add host " + host + " to vSphere cluster due to " + taskResult);
            }
            serviceContext.waitForTaskProgressDone(morTask);

            // init morHost after it has been created
            morHost = vclient.getDecendentMoRef(morCluster, "HostSystem", host);
            if(morHost == null) {
                throw new CloudRuntimeException("Successfully added host into vSphere but unable to find it later on?!. Please make sure you are either using IP address or full qualified domain name for host");
            }
        }
View Full Code Here

Examples of com.cloud.hypervisor.vmware.util.VmwareClient

        String serviceUrl = "https://" + vCenterAddress + "/sdk/vimService";
        if (s_logger.isDebugEnabled())
            s_logger.debug("initialize VmwareContext. url: " + serviceUrl + ", username: " + vCenterUserName + ", password: " +
                StringUtils.getMaskedPasswordForDisplay(vCenterPassword));

        VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++);
        vimClient.setVcenterSessionTimeout(s_vmwareMgr.getVcenterSessionTimeout());
        vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword);

        VmwareContext context = new VmwareContext(vimClient, vCenterAddress);
        context.registerStockObject(VmwareManager.CONTEXT_STOCK_NAME, s_vmwareMgr);

        context.registerStockObject("serviceconsole", s_vmwareMgr.getServiceConsolePortGroupName());
View Full Code Here

Examples of com.cloud.hypervisor.vmware.util.VmwareClient

    String serviceUrl = "https://" + vCenterAddress + "/sdk/vimService";
    if(s_logger.isDebugEnabled())
      s_logger.debug("initialize VmwareContext. url: " + serviceUrl + ", username: " + vCenterUserName + ", password: " + StringUtils.getMaskedPasswordForDisplay(vCenterPassword));

    VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++);
    vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword);

    VmwareContext context = new VmwareContext(vimClient, vCenterAddress);
    context.registerStockObject(VmwareManager.CONTEXT_STOCK_NAME, s_vmwareMgr);

    context.registerStockObject("serviceconsole", s_vmwareMgr.getServiceConsolePortGroupName());
View Full Code Here

Examples of com.cloud.hypervisor.vmware.util.VmwareClient

    assert(vCenterAddress != null);
    assert(vCenterUserName != null);
    assert(vCenterPassword != null);

    String serviceUrl = "https://" + vCenterAddress + "/sdk/vimService";
    VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++);
    vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword);
    VmwareContext context = new VmwareContext(vimClient, vCenterAddress);
    assert(context != null);
   
    context.setPoolInfo(s_pool, VmwareContextPool.composePoolKey(vCenterAddress, vCenterUserName));
    s_pool.registerOutstandingContext(context);
View Full Code Here

Examples of com.cloud.hypervisor.vmware.util.VmwareClient

        assert (vCenterAddress != null);
        assert (vCenterUserName != null);
        assert (vCenterPassword != null);

        String serviceUrl = "https://" + vCenterAddress + "/sdk/vimService";
        VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++);
        vimClient.setVcenterSessionTimeout(s_vCenterSessionTimeout);
        vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword);
        VmwareContext context = new VmwareContext(vimClient, vCenterAddress);
        assert (context != null);

        context.setPoolInfo(s_pool, VmwareContextPool.composePoolKey(vCenterAddress, vCenterUserName));
        s_pool.registerOutstandingContext(context);
View Full Code Here

Examples of com.cloud.hypervisor.vmware.util.VmwareClient

    String serviceUrl = "https://" + vCenterAddress + "/sdk/vimService";

    if(s_logger.isDebugEnabled())
      s_logger.debug("initialize VmwareContext. url: " + serviceUrl + ", username: " + vCenterUserName + ", password: " + StringUtils.getMaskedPasswordForDisplay(vCenterPassword));

    VmwareClient vimClient = new VmwareClient(vCenterAddress + "-" + s_seq++);
        vimClient.setVcenterSessionTimeout(1200000);
    vimClient.connect(serviceUrl, vCenterUserName, vCenterPassword);

    VmwareContext context = new VmwareContext(vimClient, vCenterAddress);
    return context;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.