本文整理汇总了Java中com.microsoft.azure.management.compute.VirtualHardDisk类的典型用法代码示例。如果您正苦于以下问题:Java VirtualHardDisk类的具体用法?Java VirtualHardDisk怎么用?Java VirtualHardDisk使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VirtualHardDisk类属于com.microsoft.azure.management.compute包,在下文中一共展示了VirtualHardDisk类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: withStoredWindowsImage
import com.microsoft.azure.management.compute.VirtualHardDisk; //导入依赖的package包/类
@Override
public VirtualMachineScaleSetImpl withStoredWindowsImage(String imageUrl) {
VirtualHardDisk userImageVhd = new VirtualHardDisk();
userImageVhd.withUri(imageUrl);
this.inner()
.virtualMachineProfile()
.storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE);
this.inner()
.virtualMachineProfile()
.storageProfile().osDisk().withImage(userImageVhd);
// For platform image osType will be null, azure will pick it from the image metadata.
this.inner()
.virtualMachineProfile()
.storageProfile().osDisk().withOsType(OperatingSystemTypes.WINDOWS);
this.inner()
.virtualMachineProfile()
.osProfile().withWindowsConfiguration(new WindowsConfiguration());
// sets defaults for "Stored(Custom)Image" or "VM(Platform)Image"
this.inner()
.virtualMachineProfile()
.osProfile().windowsConfiguration().withProvisionVMAgent(true);
this.inner()
.virtualMachineProfile()
.osProfile().windowsConfiguration().withEnableAutomaticUpdates(true);
return this;
}
示例2: withStoredLinuxImage
import com.microsoft.azure.management.compute.VirtualHardDisk; //导入依赖的package包/类
@Override
public VirtualMachineScaleSetImpl withStoredLinuxImage(String imageUrl) {
VirtualHardDisk userImageVhd = new VirtualHardDisk();
userImageVhd.withUri(imageUrl);
this.inner()
.virtualMachineProfile()
.storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE);
this.inner()
.virtualMachineProfile()
.storageProfile().osDisk().withImage(userImageVhd);
// For platform image osType will be null, azure will pick it from the image metadata.
this.inner()
.virtualMachineProfile()
.storageProfile().osDisk().withOsType(OperatingSystemTypes.LINUX);
this.inner()
.virtualMachineProfile()
.osProfile().withLinuxConfiguration(new LinuxConfiguration());
return this;
}
示例3: withStoredWindowsImage
import com.microsoft.azure.management.compute.VirtualHardDisk; //导入依赖的package包/类
@Override
public VirtualMachineImpl withStoredWindowsImage(String imageUrl) {
VirtualHardDisk userImageVhd = new VirtualHardDisk();
userImageVhd.withUri(imageUrl);
this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE);
this.inner().storageProfile().osDisk().withImage(userImageVhd);
// For platform image osType will be null, azure will pick it from the image metadata.
this.inner().storageProfile().osDisk().withOsType(OperatingSystemTypes.WINDOWS);
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;
}
示例4: withStoredLinuxImage
import com.microsoft.azure.management.compute.VirtualHardDisk; //导入依赖的package包/类
@Override
public VirtualMachineImpl withStoredLinuxImage(String imageUrl) {
VirtualHardDisk userImageVhd = new VirtualHardDisk();
userImageVhd.withUri(imageUrl);
this.inner().storageProfile().osDisk().withCreateOption(DiskCreateOptionTypes.FROM_IMAGE);
this.inner().storageProfile().osDisk().withImage(userImageVhd);
// For platform | custom image osType will be null, azure will pick it from the image metadata.
// But for stored image, osType needs to be specified explicitly
//
this.inner().storageProfile().osDisk().withOsType(OperatingSystemTypes.LINUX);
this.inner().osProfile().withLinuxConfiguration(new LinuxConfiguration());
return this;
}
示例5: withSpecializedOSUnmanagedDisk
import com.microsoft.azure.management.compute.VirtualHardDisk; //导入依赖的package包/类
@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;
}
示例6: withExistingVhd
import com.microsoft.azure.management.compute.VirtualHardDisk; //导入依赖的package包/类
@Override
public UnmanagedDataDiskImpl withExistingVhd(String storageAccountName, String containerName, String vhdName) {
this.inner()
.withCreateOption(DiskCreateOptionTypes.ATTACH)
.withVhd(new VirtualHardDisk()
.withUri(blobUrl(storageAccountName, containerName, vhdName)));
return this;
}
示例7: storeAt
import com.microsoft.azure.management.compute.VirtualHardDisk; //导入依赖的package包/类
@Override
public UnmanagedDataDiskImpl storeAt(String storageAccountName, String containerName, String vhdName) {
this.inner().withVhd(new VirtualHardDisk());
// URL points to where the underlying vhd needs to be stored
this.inner().vhd().withUri(blobUrl(storageAccountName, containerName, vhdName));
return this;
}
示例8: ensureDisksVhdUri
import com.microsoft.azure.management.compute.VirtualHardDisk; //导入依赖的package包/类
protected static void ensureDisksVhdUri(List<VirtualMachineUnmanagedDataDisk> dataDisks, StorageAccount storageAccount, String namePrefix) {
for (VirtualMachineUnmanagedDataDisk dataDisk : dataDisks) {
if (dataDisk.creationMethod() == DiskCreateOptionTypes.EMPTY
|| dataDisk.creationMethod() == DiskCreateOptionTypes.FROM_IMAGE) {
//New empty and from image data disk requires Vhd Uri to be set
if (dataDisk.inner().vhd() == null) {
dataDisk.inner().withVhd(new VirtualHardDisk());
dataDisk.inner().vhd().withUri(storageAccount.endPoints().primary().blob()
+ "vhds/"
+ namePrefix + "-data-disk-" + dataDisk.lun() + "-" + UUID.randomUUID().toString() + ".vhd");
}
}
}
}
示例9: getVHDUriForDataDisk
import com.microsoft.azure.management.compute.VirtualHardDisk; //导入依赖的package包/类
private static VirtualHardDisk getVHDUriForDataDisk(String vmName, String storageAccountName,
int num) {
String vhdName = vmName + DATA_DISK_SUFFIX + "-" + num;
return new VirtualHardDisk().withUri(
String.format(VHD_URI_FORMAT, storageAccountName, vhdName));
}
示例10: getVHDUriForOSDisk
import com.microsoft.azure.management.compute.VirtualHardDisk; //导入依赖的package包/类
private static VirtualHardDisk getVHDUriForOSDisk(String vmName, String storageAccountName) {
String vhdName = vmName + BOOT_DISK_SUFFIX;
return new VirtualHardDisk().withUri(
String.format(VHD_URI_FORMAT, storageAccountName, vhdName));
}