当前位置: 首页>>代码示例>>Java>>正文


Java VirtualHardDisk类代码示例

本文整理汇总了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;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:27,代码来源:VirtualMachineScaleSetImpl.java

示例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;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:20,代码来源:VirtualMachineScaleSetImpl.java

示例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;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:15,代码来源:VirtualMachineImpl.java

示例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;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:14,代码来源:VirtualMachineImpl.java

示例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;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:11,代码来源:VirtualMachineImpl.java

示例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;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:9,代码来源:UnmanagedDataDiskImpl.java

示例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;
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:8,代码来源:UnmanagedDataDiskImpl.java

示例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");
            }
        }
    }
}
 
开发者ID:Azure,项目名称:azure-libraries-for-java,代码行数:15,代码来源:UnmanagedDataDiskImpl.java

示例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));
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:9,代码来源:AzureInstanceService.java

示例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));
    }
 
开发者ID:vmware,项目名称:photon-model,代码行数:8,代码来源:AzureInstanceService.java


注:本文中的com.microsoft.azure.management.compute.VirtualHardDisk类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。