Search in sources :

Example 6 with VmwareDatacenterZoneMapVO

use of com.cloud.hypervisor.vmware.VmwareDatacenterZoneMapVO in project cloudstack by apache.

the class ResultWrapper method getLoginInfo.

private LoginInfo getLoginInfo(long zoneId) {
    VmwareDatacenterZoneMapVO vmwareDcZoneMap = vmwareDcZoneMapDao.findByZoneId(zoneId);
    Long associatedVmwareDcId = vmwareDcZoneMap.getVmwareDcId();
    VmwareDatacenterVO associatedVmwareDc = vmwareDcDao.findById(associatedVmwareDcId);
    String host = associatedVmwareDc.getVcenterHost();
    String username = associatedVmwareDc.getUser();
    String password = associatedVmwareDc.getPassword();
    return new LoginInfo(host, username, password);
}
Also used : LoginInfo(org.apache.cloudstack.util.LoginInfo) VmwareDatacenterZoneMapVO(com.cloud.hypervisor.vmware.VmwareDatacenterZoneMapVO) VmwareDatacenterVO(com.cloud.hypervisor.vmware.VmwareDatacenterVO)

Example 7 with VmwareDatacenterZoneMapVO

use of com.cloud.hypervisor.vmware.VmwareDatacenterZoneMapVO in project cloudstack by apache.

the class VmwareManagerImplTest method beforeTest.

@Before
public void beforeTest() {
    VmwareDatacenterZoneMapVO vmwareDatacenterZoneMap = new VmwareDatacenterZoneMapVO();
    vmwareDatacenterZoneMap.setZoneId(1);
    vmwareDatacenterZoneMap.setVmwareDcId(1);
    VmwareDatacenterVO vmwareDatacenterVO = new VmwareDatacenterVO(1, "some-guid", "some-name", "10.1.1.1", "username", "password");
    Mockito.doReturn(vmwareDatacenterZoneMap).when(vmwareDatacenterZoneMapDao).findByZoneId(Mockito.anyLong());
    Mockito.doReturn(vmwareDatacenterVO).when(vmwareDcDao).findById(Mockito.anyLong());
    Mockito.doReturn(1L).when(updateVmwareDcCmd).getZoneId();
}
Also used : VmwareDatacenterZoneMapVO(com.cloud.hypervisor.vmware.VmwareDatacenterZoneMapVO) VmwareDatacenterVO(com.cloud.hypervisor.vmware.VmwareDatacenterVO) Before(org.junit.Before)

Aggregations

VmwareDatacenterZoneMapVO (com.cloud.hypervisor.vmware.VmwareDatacenterZoneMapVO)7 VmwareDatacenterVO (com.cloud.hypervisor.vmware.VmwareDatacenterVO)5 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)3 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)2 ResourceInUseException (com.cloud.exception.ResourceInUseException)2 DatacenterMO (com.cloud.hypervisor.vmware.mo.DatacenterMO)2 VmwareContext (com.cloud.hypervisor.vmware.util.VmwareContext)2 RemoteException (java.rmi.RemoteException)2 AgentUnavailableException (com.cloud.exception.AgentUnavailableException)1 DiscoveredWithErrorException (com.cloud.exception.DiscoveredWithErrorException)1 DiscoveryException (com.cloud.exception.DiscoveryException)1 OperationTimedoutException (com.cloud.exception.OperationTimedoutException)1 DB (com.cloud.utils.db.DB)1 TransactionCallbackNoReturn (com.cloud.utils.db.TransactionCallbackNoReturn)1 TransactionStatus (com.cloud.utils.db.TransactionStatus)1 ManagedObjectReference (com.vmware.vim25.ManagedObjectReference)1 IOException (java.io.IOException)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)1