VirtualMachineImpl withUnmanagedDataDisk(UnmanagedDataDiskImpl dataDisk) { this.inner() .storageProfile() .dataDisks() .add(dataDisk.inner()); this.unmanagedDataDisks .add(dataDisk); return this; }
@Override public VirtualMachineImpl withOSDiskSizeInGB(Integer size) { this.inner().storageProfile().osDisk().withDiskSizeGB(size); return this; }
@Override public VirtualMachineImpl withOSDiskName(String name) { this.inner().storageProfile().osDisk().withName(name); return this; }
private void setImageBasedDataDisks() { List<DataDisk> dataDisks = vm.inner().storageProfile().dataDisks(); for (DataDisk dataDisk : this.newDisksFromImage) { dataDisk.withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); // Don't set default storage account type for the disk, either user has to specify it explicitly or let // CRP pick it from the image dataDisk.withName(null); dataDisks.add(dataDisk); } }
@Override public VirtualMachineImpl withOSDiskSizeInGB(Integer size) { this.inner().storageProfile().osDisk().withDiskSizeGB(size); return this; }
@Override public VirtualMachineImpl withOSDiskSizeInGB(int size) { this.inner().storageProfile().osDisk().withDiskSizeGB(size); return this; }
@Override public VirtualMachineImpl withOSDiskName(String name) { this.inner().storageProfile().osDisk().withName(name); return this; }
@Override public VirtualMachineImpl withOSDiskCaching(CachingTypes cachingType) { this.inner().storageProfile().osDisk().withCaching(cachingType); return this; }
private void setImageBasedDataDisks() { List<DataDisk> dataDisks = vm.inner().storageProfile().dataDisks(); for (DataDisk dataDisk : this.newDisksFromImage) { dataDisk.withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); // Don't set default storage account type for the disk, either user has to specify it explicitly or let // CRP pick it from the image dataDisk.withName(null); dataDisks.add(dataDisk); } }
@Override public VirtualMachineImpl withOSDiskEncryptionSettings(DiskEncryptionSettings settings) { this.inner().storageProfile().osDisk().withEncryptionSettings(settings); return this; }
@Override public VirtualMachineImpl withSpecializedOSUnmanagedDisk(String osDiskUrl, OperatingSystemTypes osType) { VirtualHardDisk osVhd = new VirtualHardDisk(); osVhd.withUri(osDiskUrl); this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.ATTACH); this.inner().storageProfile().osDisk().withVhd(osVhd); this.inner().storageProfile().osDisk().withOsType(osType); this.inner().storageProfile().osDisk().withManagedDisk(null); return this; }
@Override public VirtualMachineImpl withSpecializedOSDisk(Disk disk, OperatingSystemTypes osType) { ManagedDiskParameters diskParametersInner = new ManagedDiskParameters(); diskParametersInner.withId(disk.id()); this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.ATTACH); this.inner().storageProfile().osDisk().withManagedDisk(diskParametersInner); this.inner().storageProfile().osDisk().withOsType(osType); this.inner().storageProfile().osDisk().withVhd(null); return this; }
@Override public VirtualMachineImpl withSpecificLinuxImageVersion(ImageReference imageReference) { this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner().storageProfile().withImageReference(imageReference); this.inner().osProfile().withLinuxConfiguration(new LinuxConfiguration()); this.isMarketplaceLinuxImage = true; return this; }
@Override public VirtualMachineImpl withSpecificLinuxImageVersion(ImageReference imageReference) { this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner().storageProfile().withImageReference(imageReference); this.inner().osProfile().withLinuxConfiguration(new LinuxConfiguration()); this.isMarketplaceLinuxImage = true; return this; }
@Override public String osUnmanagedDiskVhdUri() { if (isManagedDiskEnabled()) { return null; } return inner().storageProfile().osDisk().vhd().uri(); }
@Override public VirtualMachineImpl withLinuxCustomImage(String customImageId) { ImageReference imageReferenceInner = new ImageReference(); imageReferenceInner.withId(customImageId); this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner().storageProfile().withImageReference(imageReferenceInner); this.inner().osProfile().withLinuxConfiguration(new LinuxConfiguration()); this.isMarketplaceLinuxImage = true; return this; }
@Override public VirtualMachineImpl withLinuxCustomImage(String customImageId) { ImageReference imageReferenceInner = new ImageReference(); imageReferenceInner.withId(customImageId); this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner().storageProfile().withImageReference(imageReferenceInner); this.inner().osProfile().withLinuxConfiguration(new LinuxConfiguration()); this.isMarketplaceLinuxImage = true; return this; }
@Override public VirtualMachineImpl withSpecificWindowsImageVersion(ImageReference imageReference) { this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner().storageProfile().withImageReference(imageReference); this.inner().osProfile().withWindowsConfiguration(new WindowsConfiguration()); // sets defaults for "Stored(User)Image" or "VM(Platform)Image" this.inner().osProfile().windowsConfiguration().withProvisionVMAgent(true); this.inner().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); return this; }
@Override public VirtualMachineImpl withWindowsCustomImage(String customImageId) { ImageReference imageReferenceInner = new ImageReference(); imageReferenceInner.withId(customImageId); this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner().storageProfile().withImageReference(imageReferenceInner); this.inner().osProfile().withWindowsConfiguration(new WindowsConfiguration()); // sets defaults for "Stored(User)Image", "VM(Platform | Custom | Gallery)Image" this.inner().osProfile().windowsConfiguration().withProvisionVMAgent(true); this.inner().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); return this; }
@Override public VirtualMachineImpl withWindowsCustomImage(String customImageId) { ImageReference imageReferenceInner = new ImageReference(); imageReferenceInner.withId(customImageId); this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE); this.inner().storageProfile().withImageReference(imageReferenceInner); this.inner().osProfile().withWindowsConfiguration(new WindowsConfiguration()); // sets defaults for "Stored(User)Image", "VM(Platform | Custom | Gallery)Image" this.inner().osProfile().windowsConfiguration().withProvisionVMAgent(true); this.inner().osProfile().windowsConfiguration().withEnableAutomaticUpdates(true); return this; }