name>"$dataDisk=Get-AzDisk-ResourceGroupName$resourceGroup-DiskName"<your shared disk name>"$vm=Add-AzVMDataDisk-VM$vm-Name"<your shared disk name>"-CreateOptionAttach-ManagedDiskId$dataDisk.Id-Lun"<available LUN - check disk setting of the VM>"Update-AzVm-VM$vm-ResourceGroupN...
以下命令将 OS 磁盘作为托管磁盘添加到 $VirtualMachine 中存储的虚拟机。 PowerShell 复制 # Set OS Disk $osDiskName = "osDisk" $VirtualMachine = Set-AzVMOSDisk -VM $VirtualMachine -Name $osDiskName ` -CreateOption FromImage -Windows 添加...
.withAdminUsername("azureuser").withAdminPassword("Azure12345678").withComputerName("myVM").withNewDataDisk(254, 0, CachingTypes.READ_WRITE, StorageAccountTypes.PREMIUM_LRS).withExistingAvailabilitySet(availabilitySet).withSize("Standard_DS1").create(); JDK中WithNewDataDisk接口说明: /*** Specifi...
Mount the disk Create a directory to mount the file system usingmkdir. The following example creates a directory at/datadrive: Bash sudomkdir/datadrive Usemountto then mount the filesystem. The following example mounts the/dev/sdc1partition to the/datadrivemount point: ...
如果想对正在运行的VM磁盘做复制,可以用az disk create的方式来创建,源选对就可以: 如果想对正在运行的VM磁盘做导出,必须先停机,将这个盘解除attach才可以执行,页面上操作的话也会有明确的提示: 接下来的步骤跟快照中导出后再创建虚机一样,同样的方式也可以支持跨region创建。
az disk show使用磁碟名稱和資源群組名稱取得受控磁碟屬性。 Id 屬性用來將受控磁碟連結至新的 VM az vm create建立使用受控 OS 磁碟的 VM 下一步 如需Azure CLI 的詳細資訊,請參閱Azure CLI 文件。 您可以在Azure Linux VM 文件中找到其他的虛擬機器 CLI 指令碼範例。
$vmName="myVM"$computerName="myComputer"$vmSize="Standard_DS1_v2"$location="China East"$imageName="yourImageName" 使用通用 OS VHD 创建映像。 PowerShell复制 $imageConfig=New-AzureRmImageConfig-Location$location$imageConfig=Set-AzureRmImageOsDisk-Image$imageConfig-OsTypeWindows-OsStateGeneralized-...
Create new VM. Expand OS disk Recognize the OS disk changes in VM Create custom image Create VMs from the image Note: Achieve the target via Azure CLI 2.0 in this document. Limitation: Create VM from customized image can only succeed within the same resource group. ...
Azure creates the operating system disk for you when you create a virtual machine. If you use an image that includes data disks, then Azure also creates the data disks when it creates the virtual machine. (You can use an image from Azure or a partner, or one you provide. For more ...
如果想对正在运行的VM磁盘做复制,可以用az disk create的方式来创建,源选对就可以: 如果想对正在运行的VM磁盘做导出,必须先停机,将这个盘解除attach才可以执行,页面上操作的话也会有明确的提示: 接下来的步骤跟快照中导出后再创建虚机一样,同样的方式也可以支持跨region创建。