Search in sources :

Example 1 with StorageAccountCreateParametersInner

use of com.microsoft.azure.management.storage.implementation.StorageAccountCreateParametersInner in project photon-model by vmware.

the class AzureInstanceService method createStorageAccount.

private DeferredResult<AzureInstanceContext> createStorageAccount(AzureInstanceContext ctx) {
    if (ctx.reuseExistingStorageAccount() || ctx.useManagedDisks()) {
        // no need to create a storage account
        logInfo("Not Creating any new storage Account. Reusing existing ones or using managed" + " disks.");
        return DeferredResult.completed(ctx);
    }
    String msg = "Create Azure Storage Account [" + ctx.storageAccountName + "] for [" + ctx.vmName + "] VM";
    StorageAccountCreateParametersInner storageParameters = new StorageAccountCreateParametersInner();
    storageParameters.withLocation(ctx.child.description.regionId);
    storageParameters.withSku(new SkuInner().withName(SkuName.STANDARD_LRS));
    storageParameters.withKind(Kind.STORAGE);
    StorageAccountProvisioningCallback handler = new StorageAccountProvisioningCallback(ctx, msg);
    getStorageManagementClientImpl(ctx).storageAccounts().createAsync(ctx.storageAccountRGName, ctx.storageAccountName, storageParameters, handler);
    return handler.toDeferredResult().thenApply(ignore -> ctx);
}
Also used : SkuInner(com.microsoft.azure.management.storage.implementation.SkuInner) StorageAccountCreateParametersInner(com.microsoft.azure.management.storage.implementation.StorageAccountCreateParametersInner)

Aggregations

SkuInner (com.microsoft.azure.management.storage.implementation.SkuInner)1 StorageAccountCreateParametersInner (com.microsoft.azure.management.storage.implementation.StorageAccountCreateParametersInner)1