use of com.vmware.photon.controller.model.resources.ResourcePoolService.ResourcePoolState in project photon-model by vmware.
the class AWSResetServiceTest method initResourcePoolAndComputeHost.
/**
* Creates the state associated with the resource pool, compute host and the VM to be created.
*
* @throws Throwable
*/
private void initResourcePoolAndComputeHost() throws Throwable {
// Create a resource pool where the VM will be housed
ResourcePoolState resourcePool = createAWSResourcePool(this.host);
AuthCredentialsServiceState auth = createAWSAuthentication(this.host, this.accessKey, this.secretKey);
this.endpointState = TestAWSSetupUtils.createAWSEndpointState(this.host, auth.documentSelfLink, resourcePool.documentSelfLink);
// create a compute host for the AWS EC2 VM
this.computeHost = createAWSComputeHost(this.host, this.endpointState, zoneId, regionId, this.isAwsClientMock, this.awsMockEndpointReference, null);
}
use of com.vmware.photon.controller.model.resources.ResourcePoolService.ResourcePoolState in project photon-model by vmware.
the class LongRunEndToEndStatsCollectionTest method initResourcePoolAndComputeHost.
/**
* Creates the state associated with the resource pool, compute host and the VM to be created.
*
* @throws Throwable
*/
private void initResourcePoolAndComputeHost() throws Throwable {
// Create a resource pool where the VM will be housed
ResourcePoolState resourcePool = createAWSResourcePool(this.host);
AuthCredentialsServiceState auth = createAWSAuthentication(this.host, this.accessKey, this.secretKey);
this.endpointState = TestAWSSetupUtils.createAWSEndpointState(this.host, auth.documentSelfLink, resourcePool.documentSelfLink);
// create a compute host for the AWS EC2 VM
this.computeHost = createAWSComputeHost(this.host, this.endpointState, null, /*zoneId*/
this.useAllRegions ? null : regionId, this.isAwsClientMock, this.awsMockEndpointReference, null);
}
use of com.vmware.photon.controller.model.resources.ResourcePoolService.ResourcePoolState in project photon-model by vmware.
the class TestAWSProvisionTask method initResourcePoolAndComputeHost.
/**
* Creates the state associated with the resource pool, compute host and the VM to be created.
*
* @throws Throwable
*/
private void initResourcePoolAndComputeHost() throws Throwable {
// Create a resource pool where the VM will be housed
ResourcePoolState resourcePool = createAWSResourcePool(this.host);
AuthCredentialsServiceState auth = createAWSAuthentication(this.host, this.accessKey, this.secretKey);
this.endpointState = TestAWSSetupUtils.createAWSEndpointState(this.host, auth.documentSelfLink, resourcePool.documentSelfLink);
// create a compute host for the AWS EC2 VM
this.computeHost = createAWSComputeHost(this.host, this.endpointState, zoneId, regionId, this.isAwsClientMock, this.awsMockEndpointReference, null);
}
use of com.vmware.photon.controller.model.resources.ResourcePoolService.ResourcePoolState in project photon-model by vmware.
the class ModelUtils method createResourcePool.
public static ResourcePoolState createResourcePool(BaseModelTest test, String endpointLink) throws Throwable {
ResourcePoolState poolState = new ResourcePoolState();
poolState.name = UUID.randomUUID().toString();
poolState.id = poolState.name;
poolState.documentSelfLink = poolState.id;
poolState.maxCpuCount = 1600L;
poolState.minCpuCount = 16L;
poolState.minMemoryBytes = 1024L * 1024L * 1024L * 46L;
poolState.maxMemoryBytes = poolState.minMemoryBytes * 2;
poolState.minDiskCapacityBytes = poolState.maxDiskCapacityBytes = 1024L * 1024L * 1024L * 1024L;
if (endpointLink != null) {
poolState.customProperties = new HashMap<>();
poolState.customProperties.put(ComputeProperties.ENDPOINT_LINK_PROP_NAME, endpointLink);
}
return test.postServiceSynchronously(ResourcePoolService.FACTORY_LINK, poolState, ResourcePoolState.class);
}
use of com.vmware.photon.controller.model.resources.ResourcePoolService.ResourcePoolState in project photon-model by vmware.
the class EndpointAllocationTaskService method createResourcePoolOp.
private Operation createResourcePoolOp(EndpointState state) {
ResourcePoolState poolState = new ResourcePoolState();
poolState.customProperties = new HashMap<>();
poolState.customProperties.put(ENDPOINT_LINK_PROP_NAME, state.documentSelfLink);
String name = String.format("%s-%s", state.endpointType, state.name);
poolState.name = name;
poolState.id = poolState.name;
poolState.tenantLinks = state.tenantLinks;
return Operation.createPost(this, ResourcePoolService.FACTORY_LINK).setBody(poolState);
}
Aggregations