@Override public String vhdUri() { return this.inner().vhd().uri(); }
@Override public String vhdUri() { return this.inner().vhd().uri(); }
/** * Checks whether the OS disk is directly attached to a unmanaged VHD. * * @param osDisk the osDisk value in the storage profile * @return true if the OS disk is attached to a unmanaged VHD, false otherwise */ private boolean isOSDiskAttachedUnmanaged(OSDisk osDisk) { return osDisk.createOption() == DiskCreateOptionTypes.ATTACH && osDisk.vhd() != null && osDisk.vhd().uri() != null; }
/** * Checks whether the OS disk is directly attached to a unmanaged VHD. * * @param osDisk the osDisk value in the storage profile * @return true if the OS disk is attached to a unmanaged VHD, false otherwise */ private boolean isOSDiskAttachedUnmanaged(OSDisk osDisk) { return osDisk.createOption() == DiskCreateOptionTypes.ATTACH && osDisk.vhd() != null && osDisk.vhd().uri() != null; }
@Override public String sourceImageUri() { if (this.inner().image() != null) { return this.inner().image().uri(); } return null; }
/** * Checks whether the OS disk is based on a stored image ('captured' or 'bring your own feature'). * * @param storageProfile the storage profile * @return true if the OS disk is configured to use custom image ('captured' or 'bring your own feature') */ private boolean isOSDiskFromStoredImage(VirtualMachineScaleSetStorageProfile storageProfile) { VirtualMachineScaleSetOSDisk osDisk = storageProfile.osDisk(); return isOSDiskFromImage(osDisk) && osDisk.image() != null && osDisk.image().uri() != null; }
/** * Checks whether the OS disk is based on a stored image ('captured' or 'bring your own feature'). * * @param storageProfile the storage profile * @return true if the OS disk is configured to use custom image ('captured' or 'bring your own feature') */ private boolean isOSDiskFromStoredImage(VirtualMachineScaleSetStorageProfile storageProfile) { VirtualMachineScaleSetOSDisk osDisk = storageProfile.osDisk(); return isOSDiskFromImage(osDisk) && osDisk.image() != null && osDisk.image().uri() != null; }
@Override public String sourceImageUri() { if (this.inner().image() != null) { return this.inner().image().uri(); } return null; }
/** * Checks whether the OS disk is based on a stored image ('captured' or 'bring your own feature'). * <p> * A stored image is created by calling {@link VirtualMachine#capture(String, String, boolean)}. * * @param storageProfile the storage profile * @return true if the OS disk is configured to use custom image ('captured' or 'bring your own feature') */ private boolean isOSDiskFromStoredImage(StorageProfile storageProfile) { OSDisk osDisk = storageProfile.osDisk(); return isOSDiskFromImage(osDisk) && osDisk.image() != null && osDisk.image().uri() != null; }
/** * Checks whether the OS disk is based on a stored image ('captured' or 'bring your own feature'). * <p> * A stored image is created by calling {@link VirtualMachine#capture(String, String, boolean)}. * * @param storageProfile the storage profile * @return true if the OS disk is configured to use custom image ('captured' or 'bring your own feature') */ private boolean isOSDiskFromStoredImage(StorageProfile storageProfile) { OSDisk osDisk = storageProfile.osDisk(); return isOSDiskFromImage(osDisk) && osDisk.image() != null && osDisk.image().uri() != null; }
@Override public String osUnmanagedDiskVhdUri() { if (isManagedDiskEnabled()) { return null; } return inner().storageProfile().osDisk().vhd().uri(); }
@Override public String osUnmanagedDiskVhdUri() { if (isManagedDiskEnabled()) { return null; } return inner().storageProfile().osDisk().vhd().uri(); }
protected static void ensureDisksVhdUri(List<VirtualMachineUnmanagedDataDisk> dataDisks, String namePrefix) { String containerUrl = null; for (VirtualMachineUnmanagedDataDisk dataDisk : dataDisks) { if (dataDisk.creationMethod() == DiskCreateOptionTypes.EMPTY && dataDisk.inner().vhd() != null) { int idx = dataDisk.inner().vhd().uri().lastIndexOf('/'); containerUrl = dataDisk.inner().vhd().uri().substring(0, idx); break; } } if (containerUrl != null) { for (VirtualMachineUnmanagedDataDisk dataDisk : dataDisks) { if (dataDisk.creationMethod() == DiskCreateOptionTypes.EMPTY) { //New data disk requires Vhd Uri to be set if (dataDisk.inner().vhd() == null) { dataDisk.inner().withVhd(new VirtualHardDisk()); dataDisk.inner().vhd().withUri(containerUrl + namePrefix + "-data-disk-" + dataDisk.lun() + "-" + UUID.randomUUID().toString() + ".vhd"); } } } } }
protected static void ensureDisksVhdUri(List<VirtualMachineUnmanagedDataDisk> dataDisks, String namePrefix) { String containerUrl = null; for (VirtualMachineUnmanagedDataDisk dataDisk : dataDisks) { if (dataDisk.creationMethod() == DiskCreateOptionTypes.EMPTY && dataDisk.inner().vhd() != null) { int idx = dataDisk.inner().vhd().uri().lastIndexOf('/'); containerUrl = dataDisk.inner().vhd().uri().substring(0, idx); break; } } if (containerUrl != null) { for (VirtualMachineUnmanagedDataDisk dataDisk : dataDisks) { if (dataDisk.creationMethod() == DiskCreateOptionTypes.EMPTY) { //New data disk requires Vhd Uri to be set if (dataDisk.inner().vhd() == null) { dataDisk.inner().withVhd(new VirtualHardDisk()); dataDisk.inner().vhd().withUri(containerUrl + namePrefix + "-data-disk-" + dataDisk.lun() + "-" + UUID.randomUUID().toString() + ".vhd"); } } } } }
@Override public String osUnmanagedDiskVhdUri() { if (this.inner().storageProfile().osDisk().vhd() != null) { return this.inner().storageProfile().osDisk().vhd().uri(); } return null; }
@Override public String storedImageUnmanagedVhdUri() { if (this.inner().storageProfile().osDisk().image() != null) { return this.inner().storageProfile().osDisk().image().uri(); } return null; }
@Override public String osUnmanagedDiskVhdUri() { if (this.inner().storageProfile().osDisk().vhd() != null) { return this.inner().storageProfile().osDisk().vhd().uri(); } return null; }
@Override public String storedImageUnmanagedVhdUri() { if (this.inner().storageProfile().osDisk().image() != null) { return this.inner().storageProfile().osDisk().image().uri(); } return null; }
@Override public boolean isOSBasedOnStoredImage() { if (this.inner().storageProfile().osDisk() != null && this.inner().storageProfile().osDisk().image() != null) { return this.inner().storageProfile().osDisk().image().uri() != null; } return false; }
@Override public boolean isOSBasedOnStoredImage() { if (this.inner().storageProfile().osDisk() != null && this.inner().storageProfile().osDisk().image() != null) { return this.inner().storageProfile().osDisk().image().uri() != null; } return false; }