Search in sources :

Example 66 with DiskState

use of com.vmware.photon.controller.model.resources.DiskService.DiskState in project photon-model by vmware.

the class AWSDiskService method createDisk.

/**
 * Create a volume on aws that represents the requested disk.
 */
private void createDisk(AWSDiskContext context) {
    if (context.diskRequest.isMockRequest) {
        Volume vol = getMockVolume();
        updateDiskState(vol, context, AwsDiskStage.FINISHED);
        return;
    }
    DiskState diskState = context.disk;
    // add endpointLinks
    AdapterUtils.addToEndpointLinks(diskState, context.disk.endpointLink);
    if (diskState.capacityMBytes <= 0) {
        String message = "Disk size has to be positive";
        this.logWarning(() -> "[AWSDiskService] " + message);
        throw new IllegalArgumentException(message);
    }
    if (diskState.customProperties != null && diskState.customProperties.get(DEVICE_TYPE) != null && diskState.customProperties.get(DEVICE_TYPE).equals(AWSConstants.AWSStorageType.INSTANCE_STORE.getName())) {
        String message = "Independent Instance Store disk cannot be created.";
        this.logWarning(() -> "[AWSDiskService] " + message);
        throw new IllegalArgumentException(message);
    }
    CreateVolumeRequest req = new CreateVolumeRequest();
    String zoneId = diskState.zoneId;
    if (zoneId == null) {
        List<AvailabilityZone> availabilityZoneList = context.client.getAvailabilityZones();
        if (availabilityZoneList.isEmpty()) {
            String message = String.format("No zones are available in the region %s:", diskState.regionId);
            this.logSevere(() -> "[AWSDiskService] " + message);
            throw new IllegalArgumentException(message);
        }
        zoneId = availabilityZoneList.get(0).getZoneName();
    }
    // set availability zone
    req.withAvailabilityZone(zoneId);
    // set volume size
    int diskSize = (int) diskState.capacityMBytes / 1024;
    req.withSize(diskSize);
    // set encrypted field
    Boolean encrypted = diskState.encrypted == null ? false : diskState.encrypted;
    req.withEncrypted(encrypted);
    AWSUtils.setEbsDefaultsIfNotSet(diskState, Boolean.TRUE);
    validateSizeSupportedByVolumeType(diskSize, diskState.customProperties.get(VOLUME_TYPE));
    // set volume type
    if (diskState.customProperties.containsKey(VOLUME_TYPE)) {
        req.withVolumeType(diskState.customProperties.get(VOLUME_TYPE));
    }
    // set iops
    String diskIops = diskState.customProperties.get(DISK_IOPS);
    if (diskIops != null && !diskIops.isEmpty()) {
        int iops = Integer.parseInt(diskIops);
        if (iops > diskSize * MAX_IOPS_PER_GiB) {
            String info = String.format("[AWSDiskService] Requested IOPS (%s) exceeds" + " the maximum value supported by %sGiB disk. Continues " + "provisioning the disk with %s iops", iops, diskSize, diskSize * MAX_IOPS_PER_GiB);
            this.logInfo(() -> info);
            iops = diskSize * MAX_IOPS_PER_GiB;
        }
        req.withIops(iops);
    }
    AsyncHandler<CreateVolumeRequest, CreateVolumeResult> creationHandler = new AWSDiskCreationHandler(this, context);
    context.client.createVolume(req, creationHandler);
}
Also used : CreateVolumeRequest(com.amazonaws.services.ec2.model.CreateVolumeRequest) Volume(com.amazonaws.services.ec2.model.Volume) CreateVolumeResult(com.amazonaws.services.ec2.model.CreateVolumeResult) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) AvailabilityZone(com.amazonaws.services.ec2.model.AvailabilityZone)

Example 67 with DiskState

use of com.vmware.photon.controller.model.resources.DiskService.DiskState in project photon-model by vmware.

the class AWSInstanceService method createInstance.

private void createInstance(AWSInstanceContext aws) {
    if (aws.computeRequest.isMockRequest) {
        aws.taskManager.finishTask();
        return;
    }
    final DiskState bootDisk = aws.bootDisk;
    if (bootDisk == null) {
        aws.taskManager.patchTaskToFailure(new IllegalStateException("AWS bootDisk not specified"));
        return;
    }
    if (bootDisk.bootConfig != null && bootDisk.bootConfig.files.length > 1) {
        aws.taskManager.patchTaskToFailure(new IllegalStateException("Only 1 configuration file allowed"));
        return;
    }
    // This a single disk state with a bootConfig. There's no expectation
    // that it does exists, but if it does, we only support cloud configs at
    // this point.
    String cloudConfig = null;
    if (bootDisk.bootConfig != null && bootDisk.bootConfig.files.length > CLOUD_CONFIG_DEFAULT_FILE_INDEX) {
        cloudConfig = bootDisk.bootConfig.files[CLOUD_CONFIG_DEFAULT_FILE_INDEX].contents;
    }
    String instanceType = aws.child.description.instanceType;
    if (instanceType == null) {
        // fallback to legacy usage of name
        instanceType = aws.child.description.name;
    }
    if (instanceType == null) {
        aws.error = new IllegalStateException("AWS Instance type not specified");
        aws.stage = AWSInstanceStage.ERROR;
        handleAllocation(aws);
        return;
    }
    RunInstancesRequest runInstancesRequest = new RunInstancesRequest().withImageId(aws.bootDiskImageNativeId).withInstanceType(instanceType).withMinCount(1).withMaxCount(1).withMonitoring(true).withTagSpecifications(new TagSpecification().withResourceType(ResourceType.Instance).withTags(aws.getAWSTags()));
    if (aws.placement != null) {
        runInstancesRequest.withPlacement(new Placement(aws.placement));
    }
    if (aws.child.customProperties != null && aws.child.customProperties.containsKey(CUSTOM_PROP_SSH_KEY_NAME)) {
        runInstancesRequest = runInstancesRequest.withKeyName(aws.child.customProperties.get(CUSTOM_PROP_SSH_KEY_NAME));
    }
    if (!aws.dataDisks.isEmpty() || bootDisk.capacityMBytes > 0 || bootDisk.customProperties != null) {
        DescribeImagesRequest imagesDescriptionRequest = new DescribeImagesRequest();
        imagesDescriptionRequest.withImageIds(aws.bootDiskImageNativeId);
        DescribeImagesResult imagesDescriptionResult = aws.amazonEC2Client.describeImages(imagesDescriptionRequest);
        if (imagesDescriptionResult.getImages().size() != 1) {
            handleError(aws, new IllegalStateException("AWS ImageId is not available"));
            return;
        }
        Image image = imagesDescriptionResult.getImages().get(0);
        AssertUtil.assertNotNull(aws.instanceTypeInfo, "instanceType cannot be null");
        List<BlockDeviceMapping> blockDeviceMappings = image.getBlockDeviceMappings();
        String rootDeviceType = image.getRootDeviceType();
        String bootDiskType = bootDisk.customProperties.get(DEVICE_TYPE);
        boolean hasHardConstraint = containsHardConstraint(bootDisk);
        BlockDeviceMapping rootDeviceMapping = null;
        try {
            // The number of instance-store disks that will be provisioned is limited by the instance-type.
            suppressExcessInstanceStoreDevices(blockDeviceMappings, aws.instanceTypeInfo);
            for (BlockDeviceMapping blockDeviceMapping : blockDeviceMappings) {
                EbsBlockDevice ebs = blockDeviceMapping.getEbs();
                String diskType = getDeviceType(ebs);
                if (hasHardConstraint) {
                    validateIfDeviceTypesAreMatching(diskType, bootDiskType);
                }
                if (blockDeviceMapping.getNoDevice() != null) {
                    continue;
                }
                if (rootDeviceType.equals(AWSStorageType.EBS.getName()) && blockDeviceMapping.getDeviceName().equals(image.getRootDeviceName())) {
                    rootDeviceMapping = blockDeviceMapping;
                    continue;
                }
                DiskState diskState = new DiskState();
                copyCustomProperties(diskState, bootDisk);
                addMandatoryProperties(diskState, blockDeviceMapping, aws);
                updateDeviceMapping(diskType, bootDiskType, blockDeviceMapping.getDeviceName(), ebs, diskState);
                // update disk state with final volume-type and iops
                if (diskType.equals(AWSStorageType.EBS.getName())) {
                    diskState.customProperties.put(VOLUME_TYPE, ebs.getVolumeType());
                    diskState.customProperties.put(DISK_IOPS, String.valueOf(ebs.getIops()));
                }
                aws.imageDisks.add(diskState);
            }
            customizeBootDiskProperties(bootDisk, rootDeviceType, rootDeviceMapping, hasHardConstraint, aws);
            List<DiskState> ebsDisks = new ArrayList<>();
            List<DiskState> instanceStoreDisks = new ArrayList<>();
            if (!aws.dataDisks.isEmpty()) {
                if (!rootDeviceType.equals(AWSStorageType.EBS.name().toLowerCase())) {
                    instanceStoreDisks = aws.dataDisks;
                    assertAndResetPersistence(instanceStoreDisks);
                    validateSupportForAdditionalInstanceStoreDisks(instanceStoreDisks, blockDeviceMappings, aws.instanceTypeInfo, rootDeviceType);
                } else {
                    splitDataDisks(aws.dataDisks, instanceStoreDisks, ebsDisks);
                    setEbsDefaultsIfNotSpecified(ebsDisks, Boolean.FALSE);
                    if (!instanceStoreDisks.isEmpty()) {
                        assertAndResetPersistence(instanceStoreDisks);
                        validateSupportForAdditionalInstanceStoreDisks(instanceStoreDisks, blockDeviceMappings, aws.instanceTypeInfo, rootDeviceType);
                    }
                }
            }
            // get the available attach paths for new disks and external disks
            List<String> usedDeviceNames = null;
            if (!instanceStoreDisks.isEmpty() || !ebsDisks.isEmpty() || !aws.externalDisks.isEmpty()) {
                usedDeviceNames = getUsedDeviceNames(blockDeviceMappings);
            }
            if (!instanceStoreDisks.isEmpty()) {
                List<String> usedVirtualNames = getUsedVirtualNames(blockDeviceMappings);
                blockDeviceMappings.addAll(createInstanceStoreMappings(instanceStoreDisks, usedDeviceNames, usedVirtualNames, aws.instanceTypeInfo.id, aws.instanceTypeInfo.dataDiskSizeInMB, image.getPlatform(), image.getVirtualizationType()));
            }
            if (!ebsDisks.isEmpty() || !aws.externalDisks.isEmpty()) {
                aws.availableEbsDiskNames = AWSBlockDeviceNameMapper.getAvailableNames(AWSSupportedOS.get(image.getPlatform()), AWSSupportedVirtualizationTypes.get(image.getVirtualizationType()), AWSStorageType.EBS, instanceType, usedDeviceNames);
            }
            if (!ebsDisks.isEmpty()) {
                blockDeviceMappings.addAll(createEbsDeviceMappings(ebsDisks, aws.availableEbsDiskNames));
            }
            runInstancesRequest.withBlockDeviceMappings(blockDeviceMappings);
        } catch (Exception e) {
            aws.error = e;
            aws.stage = AWSInstanceStage.ERROR;
            handleAllocation(aws);
            return;
        }
    }
    AWSNicContext primaryNic = aws.getPrimaryNic();
    if (primaryNic != null && primaryNic.nicSpec != null) {
        runInstancesRequest.withNetworkInterfaces(primaryNic.nicSpec);
    } else {
        runInstancesRequest.withSecurityGroupIds(AWSUtils.getOrCreateSecurityGroups(aws, null));
    }
    if (cloudConfig != null) {
        try {
            runInstancesRequest.setUserData(Base64.getEncoder().encodeToString(cloudConfig.getBytes(Utils.CHARSET)));
        } catch (UnsupportedEncodingException e) {
            handleError(aws, new IllegalStateException("Error encoding user data"));
            return;
        }
    }
    String message = "[AWSInstanceService] Sending run instance request for instance id: " + aws.bootDiskImageNativeId + ", instance type: " + instanceType + ", parent task id: " + aws.computeRequest.taskReference;
    this.logInfo(() -> message);
    // handler invoked once the EC2 runInstancesAsync commands completes
    AsyncHandler<RunInstancesRequest, RunInstancesResult> creationHandler = new AWSCreationHandler(this, aws);
    aws.amazonEC2Client.runInstancesAsync(runInstancesRequest, creationHandler);
}
Also used : DescribeImagesRequest(com.amazonaws.services.ec2.model.DescribeImagesRequest) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) ArrayList(java.util.ArrayList) UnsupportedEncodingException(java.io.UnsupportedEncodingException) TagSpecification(com.amazonaws.services.ec2.model.TagSpecification) Image(com.amazonaws.services.ec2.model.Image) AmazonServiceException(com.amazonaws.AmazonServiceException) AmazonEC2Exception(com.amazonaws.services.ec2.model.AmazonEC2Exception) UnsupportedEncodingException(java.io.UnsupportedEncodingException) Placement(com.amazonaws.services.ec2.model.Placement) DescribeImagesResult(com.amazonaws.services.ec2.model.DescribeImagesResult) RunInstancesResult(com.amazonaws.services.ec2.model.RunInstancesResult) EbsBlockDevice(com.amazonaws.services.ec2.model.EbsBlockDevice) BlockDeviceMapping(com.amazonaws.services.ec2.model.BlockDeviceMapping) InstanceBlockDeviceMapping(com.amazonaws.services.ec2.model.InstanceBlockDeviceMapping) RunInstancesRequest(com.amazonaws.services.ec2.model.RunInstancesRequest) AWSNicContext(com.vmware.photon.controller.model.adapters.awsadapter.AWSInstanceContext.AWSNicContext)

Example 68 with DiskState

use of com.vmware.photon.controller.model.resources.DiskService.DiskState in project photon-model by vmware.

the class AzureDiskEnumerationAdapterService method createLocalDiskState.

/**
 * Construct DiskState object from a Disk
 */
private DiskState createLocalDiskState(DiskEnumContext ctx, Disk disk) {
    DiskState diskState = new DiskState();
    String id = UUID.randomUUID().toString();
    diskState.documentSelfLink = UriUtils.buildUriPath(DiskService.FACTORY_LINK, id);
    diskState.name = disk.name;
    diskState.id = disk.id;
    diskState.capacityMBytes = (long) disk.properties.diskSizeGB * 1024;
    diskState.status = DiskStatus.AVAILABLE;
    diskState.tenantLinks = ctx.parentCompute.tenantLinks;
    diskState.resourcePoolLink = ctx.request.resourcePoolLink;
    diskState.computeHostLink = ctx.parentCompute.documentSelfLink;
    diskState.authCredentialsLink = ctx.endpointAuth.documentSelfLink;
    diskState.endpointLink = ctx.request.endpointLink;
    AdapterUtils.addToEndpointLinks(diskState, ctx.request.endpointLink);
    diskState.regionId = disk.location;
    if (diskState.tagLinks == null) {
        diskState.tagLinks = new HashSet<>();
    }
    // add internal type tags
    diskState.tagLinks.addAll(ctx.internalTagLinks);
    diskState.customProperties = new HashMap<>();
    diskState.customProperties.put(AZURE_MANAGED_DISK_TYPE, disk.properties.accountType);
    return diskState;
}
Also used : DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState)

Example 69 with DiskState

use of com.vmware.photon.controller.model.resources.DiskService.DiskState in project photon-model by vmware.

the class AzureDiskEnumerationAdapterService method createUpdateDiskStates.

private void createUpdateDiskStates(DiskEnumContext ctx, DiskEnumStages nextStage) {
    if (ctx.unattachedDisks.isEmpty()) {
        ctx.subStage = nextStage;
        handleSubStage(ctx);
        return;
    }
    Collection<Operation> opCollection = new ArrayList<>();
    ctx.unattachedDisks.entrySet().stream().forEach(entry -> {
        DiskState diskState = ctx.localDiskStates.get(entry.getKey());
        Operation diskOp = null;
        if (diskState != null) {
            diskState.status = DiskStatus.AVAILABLE;
            if (diskState.endpointLinks != null && !diskState.endpointLinks.contains(ctx.request.endpointLink)) {
                AdapterUtils.addToEndpointLinks(diskState, ctx.request.endpointLink);
            }
            if (diskState.endpointLink == null || diskState.endpointLink.equals("")) {
                diskState.endpointLink = ctx.request.endpointLink;
            }
            if (diskState.customProperties != null && diskState.customProperties.containsKey(DISK_CONTROLLER_NUMBER)) {
                diskState.customProperties.remove(DISK_CONTROLLER_NUMBER);
            }
            if (diskState.tagLinks == null) {
                diskState.tagLinks = new HashSet<>();
            }
            diskState.tagLinks.addAll(ctx.internalTagLinks);
            diskState.regionId = entry.getValue().location;
            diskOp = Operation.createPatch(createInventoryUri(getHost(), diskState.documentSelfLink)).setBody(diskState);
        } else {
            diskState = createLocalDiskState(ctx, entry.getValue());
            diskOp = Operation.createPost(createInventoryUri(getHost(), DiskService.FACTORY_LINK)).setBody(diskState);
        }
        ctx.localDiskStates.put(diskState.id, diskState);
        opCollection.add(diskOp);
    });
    if (opCollection.isEmpty()) {
        ctx.subStage = nextStage;
        handleSubStage(ctx);
        return;
    }
    logInfo(() -> "Create and/or update disk states in local document store.");
    OperationJoin.create(opCollection).setCompletion((ops, exs) -> {
        if (exs != null) {
            exs.values().forEach(ex -> logWarning(() -> String.format("Error: %s", ex.getMessage())));
            return;
        }
        logFine(() -> String.format("Transition to " + nextStage));
        ctx.subStage = nextStage;
        handleSubStage(ctx);
    }).sendWith(this);
}
Also used : QUERY_PARAM_API_VERSION(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.QUERY_PARAM_API_VERSION) ComputeEnumerateResourceRequest(com.vmware.photon.controller.model.adapterapi.ComputeEnumerateResourceRequest) DISK_STATUS_UNATTACHED(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.DISK_STATUS_UNATTACHED) QueryTask(com.vmware.xenon.services.common.QueryTask) DISK_CONTROLLER_NUMBER(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.DISK_CONTROLLER_NUMBER) AzureUriPaths(com.vmware.photon.controller.model.adapters.azure.AzureUriPaths) AZURE_MANAGED_DISK_TYPE(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.AZURE_MANAGED_DISK_TYPE) Utils(com.vmware.xenon.common.Utils) Map(java.util.Map) Disk(com.vmware.photon.controller.model.adapters.azure.model.storage.Disk) URI(java.net.URI) AzureConstants(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants) StatelessService(com.vmware.xenon.common.StatelessService) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) UUID(java.util.UUID) AdapterUtils.getDeletionState(com.vmware.photon.controller.model.adapters.util.AdapterUtils.getDeletionState) Collectors(java.util.stream.Collectors) List(java.util.List) AzureUtils(com.vmware.photon.controller.model.adapters.azure.utils.AzureUtils) TagService(com.vmware.photon.controller.model.resources.TagService) UriUtils(com.vmware.xenon.common.UriUtils) ComputeService(com.vmware.photon.controller.model.resources.ComputeService) AzureUtils.getAzureConfig(com.vmware.photon.controller.model.adapters.azure.utils.AzureUtils.getAzureConfig) DiskService(com.vmware.photon.controller.model.resources.DiskService) QueryByPages(com.vmware.photon.controller.model.query.QueryUtils.QueryByPages) LIST_DISKS_URI(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.LIST_DISKS_URI) HashMap(java.util.HashMap) PhotonModelUtils(com.vmware.photon.controller.model.resources.util.PhotonModelUtils) TagsUtil(com.vmware.photon.controller.model.adapters.util.TagsUtil) ArrayList(java.util.ArrayList) DISK_REST_API_VERSION(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.DISK_REST_API_VERSION) HashSet(java.util.HashSet) AuthCredentialsService(com.vmware.xenon.services.common.AuthCredentialsService) Query(com.vmware.xenon.services.common.QueryTask.Query) AUTH_HEADER_BEARER_PREFIX(com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants.AUTH_HEADER_BEARER_PREFIX) EnumerationStages(com.vmware.photon.controller.model.adapters.util.enums.EnumerationStages) EnumerationAction(com.vmware.photon.controller.model.adapterapi.EnumerationAction) AdapterUtils(com.vmware.photon.controller.model.adapters.util.AdapterUtils) ResourceState(com.vmware.photon.controller.model.resources.ResourceState) DiskStatus(com.vmware.photon.controller.model.resources.DiskService.DiskStatus) AdapterUriUtil(com.vmware.photon.controller.model.adapters.util.AdapterUriUtil) Operation(com.vmware.xenon.common.Operation) QueryUtils(com.vmware.photon.controller.model.query.QueryUtils) QueryTop(com.vmware.photon.controller.model.query.QueryUtils.QueryTop) ClusterUtil(com.vmware.photon.controller.model.util.ClusterUtil) ManagedDiskList(com.vmware.photon.controller.model.adapters.azure.model.storage.ManagedDiskList) PhotonModelConstants(com.vmware.photon.controller.model.constants.PhotonModelConstants) ComputeEnumerateAdapterRequest(com.vmware.photon.controller.model.adapters.util.ComputeEnumerateAdapterRequest) ApplicationTokenCredentials(com.microsoft.azure.credentials.ApplicationTokenCredentials) OperationJoin(com.vmware.xenon.common.OperationJoin) PhotonModelUriUtils.createInventoryUri(com.vmware.photon.controller.model.util.PhotonModelUriUtils.createInventoryUri) DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) ArrayList(java.util.ArrayList) Operation(com.vmware.xenon.common.Operation)

Example 70 with DiskState

use of com.vmware.photon.controller.model.resources.DiskService.DiskState in project photon-model by vmware.

the class AzureComputeEnumerationAdapterService method updateDataDiskProperties.

private void updateDataDiskProperties(EnumerationContext ctx, VirtualMachineInner vm, Collection<Operation> opCollection) {
    if (vm.storageProfile() == null) {
        return;
    }
    if (vm.storageProfile().dataDisks() != null) {
        vm.storageProfile().dataDisks().forEach(dataDisk -> {
            DiskState diskToUpdate = null;
            if (AzureUtils.isDiskManaged(vm)) {
                diskToUpdate = ctx.diskStates.get(dataDisk.managedDisk().id());
            } else {
                diskToUpdate = ctx.diskStates.get(AzureUtils.canonizeId(dataDisk.vhd().uri()));
            }
            Operation diskToUpdateOp = null;
            if (null == diskToUpdate) {
                diskToUpdate = createDataDiskState(ctx, dataDisk, AzureUtils.isDiskManaged(vm));
                diskToUpdate.regionId = vm.location();
                diskToUpdateOp = Operation.createPost(getHost(), DiskService.FACTORY_LINK).setBody(diskToUpdate);
            } else {
                // case where a lying disk in Azure (also in local store) is attached to VM
                diskToUpdate.status = DiskService.DiskStatus.ATTACHED;
                diskToUpdate.regionId = vm.location();
                diskToUpdateOp = Operation.createPatch(getHost(), diskToUpdate.documentSelfLink).setBody(diskToUpdate);
            }
            opCollection.add(diskToUpdateOp);
            ctx.diskStates.put(diskToUpdate.id, diskToUpdate);
        });
    }
}
Also used : DiskState(com.vmware.photon.controller.model.resources.DiskService.DiskState) Operation(com.vmware.xenon.common.Operation)

Aggregations

DiskState (com.vmware.photon.controller.model.resources.DiskService.DiskState)77 ArrayList (java.util.ArrayList)24 Operation (com.vmware.xenon.common.Operation)23 DiskService (com.vmware.photon.controller.model.resources.DiskService)18 ComputeState (com.vmware.photon.controller.model.resources.ComputeService.ComputeState)16 List (java.util.List)15 EnumerationAction (com.vmware.photon.controller.model.adapterapi.EnumerationAction)13 UriUtils (com.vmware.xenon.common.UriUtils)13 Utils (com.vmware.xenon.common.Utils)13 HashMap (java.util.HashMap)13 TimeUnit (java.util.concurrent.TimeUnit)13 QueryTask (com.vmware.xenon.services.common.QueryTask)12 Query (com.vmware.xenon.services.common.QueryTask.Query)12 HashSet (java.util.HashSet)12 Test (org.junit.Test)11 AzureConstants (com.vmware.photon.controller.model.adapters.azure.constants.AzureConstants)10 PhotonModelUriUtils.createInventoryUri (com.vmware.photon.controller.model.util.PhotonModelUriUtils.createInventoryUri)10 ServiceDocumentQueryResult (com.vmware.xenon.common.ServiceDocumentQueryResult)10 AuthCredentialsService (com.vmware.xenon.services.common.AuthCredentialsService)10 Map (java.util.Map)10