use of com.microsoft.azure.management.compute.VirtualMachineScaleSetManagedDiskParameters in project azure-sdk-for-java by Azure.
the class VirtualMachineScaleSetImpl method setOSDiskDefault.
private void setOSDiskDefault() {
if (isInUpdateMode()) {
return;
}
VirtualMachineScaleSetStorageProfile storageProfile = this.inner().virtualMachineProfile().storageProfile();
VirtualMachineScaleSetOSDisk osDisk = storageProfile.osDisk();
if (isOSDiskFromImage(osDisk)) {
//
if (isManagedDiskEnabled()) {
//
if (osDisk.managedDisk() == null) {
osDisk.withManagedDisk(new VirtualMachineScaleSetManagedDiskParameters());
}
if (osDisk.managedDisk().storageAccountType() == null) {
osDisk.managedDisk().withStorageAccountType(StorageAccountTypes.STANDARD_LRS);
}
osDisk.withVhdContainers(null);
// We won't set osDisk.name() explicitly for managed disk, if it is null CRP generates unique
// name for the disk resource within the resource group.
} else {
// Note:
// Native (un-managed) disk
// Supported: PlatformImage and StoredImage
// UnSupported: CustomImage
//
osDisk.withManagedDisk(null);
if (osDisk.name() == null) {
withOSDiskName(this.name() + "-os-disk");
}
}
} else {
// NOP [ODDisk CreateOption: ATTACH, ATTACH is not supported for VMSS]
}
if (this.osDiskCachingType() == null) {
withOSDiskCaching(CachingTypes.READ_WRITE);
}
}
use of com.microsoft.azure.management.compute.VirtualMachineScaleSetManagedDiskParameters in project azure-sdk-for-java by Azure.
the class VirtualMachineScaleSetImpl method withNewDataDiskFromImage.
@Override
public VirtualMachineScaleSetImpl withNewDataDiskFromImage(int imageLun, int newSizeInGB, CachingTypes cachingType, StorageAccountTypes storageAccountType) {
VirtualMachineScaleSetManagedDiskParameters managedDiskParameters = new VirtualMachineScaleSetManagedDiskParameters();
managedDiskParameters.withStorageAccountType(storageAccountType);
this.managedDataDisks.newDisksFromImage.add(new VirtualMachineScaleSetDataDisk().withLun(imageLun).withDiskSizeGB(newSizeInGB).withManagedDisk(managedDiskParameters).withCaching(cachingType));
return this;
}
use of com.microsoft.azure.management.compute.VirtualMachineScaleSetManagedDiskParameters in project azure-sdk-for-java by Azure.
the class VirtualMachineScaleSetImpl method withNewDataDisk.
@Override
public VirtualMachineScaleSetImpl withNewDataDisk(int sizeInGB, int lun, CachingTypes cachingType, StorageAccountTypes storageAccountType) {
throwIfManagedDiskDisabled(ManagedUnmanagedDiskErrors.VMSS_BOTH_UNMANAGED_AND_MANAGED_DISK_NOT_ALLOWED);
VirtualMachineScaleSetManagedDiskParameters managedDiskParameters = new VirtualMachineScaleSetManagedDiskParameters();
managedDiskParameters.withStorageAccountType(storageAccountType);
this.managedDataDisks.implicitDisksToAssociate.add(new VirtualMachineScaleSetDataDisk().withLun(lun).withDiskSizeGB(sizeInGB).withCaching(cachingType).withManagedDisk(managedDiskParameters));
return this;
}
Aggregations