仮想マシンV2(いわゆるAzure Resource Manager)での ディクス拡張方法です。
拡張後のOS操作は以下と同様だと思います(未確認)
PowerShell
ポータルでも簡単にできるのですが、よくつかうPowerShellにて。
$rg = "hoge-rg" $vmname = "hoge-vm" $vm = Get-AzureRmVM $rg $vmname $vm.StorageProfile.DataDisks[0] $vm.StorageProfile.DataDisks[0].DiskSizeGB = 100 Update-AzureRmVM $vm.ResourceGroupName -VM $vm
VM情報とって、StorageProfile中のデータティスクサイズを書き換えて、Updateすると更新されます。VMがDeallocate状態な必要があります。 起動中ですと以下のようなエラーが表示されます。
Name : hogehoge-20160302-111948 DiskSizeGB : 50 Lun : 0 Caching : None CreateOption : Empty SourceImage : VirtualHardDisk : Update-AzureRmVM : Disk resizing is allowed only when creating a VM or when the VM is dea llocated. StatusCode: 400 ReasonPhrase: Bad Request OperationID : 'e098ea5b-1a19-46d1-86de-98a522d1a495' 発生場所 行:7 文字:1 + Update-AzureRmVM $vm.ResourceGroupName -VM $vm + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Update-AzureRmVM]、ComputeCloudException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.UpdateAzureVMCommand
ちなみにShrinkはできません。
ErrorMessage: Shrinking a disk from 107374182912 bytes to 53687091712 bytes is not supported.
となります。