【问题标题】:How to Expand OS disk on a Linux VM using Cloud Shell?如何使用 Cloud Shell 在 Linux 虚拟机上扩展 OS 磁盘?
【发布时间】:2018-05-14 15:01:16
【问题描述】:

我在生产经典 VM 上遇到了一点问题。我已达到磁盘的最大容量,我需要对其进行扩展。

所以我尝试了:

azure config mode arm

然后

azure vm deallocate --resource-group XXX --name XXX

结果:

info:    Executing command vm deallocate
+ Looking up the VM "XXX"
error:   Virtual machine "XXX" not found under the resource group "XXX"
error:   Error information has been recorded to /home/xyz/.azure/azure.err
error:   vm deallocate command failed

我不明白为什么资源组中没有VM,所以我尝试列出资源组中的内容^

azure resource list

结果:

data:    /subscriptions/xyz/resourceGroups/XXX/providers/Microsoft.ClassicCompute/virtualMachines/XXX                           XXX                         XXX                     Microsoft.ClassicCompute/virtualMachines          westeurope  null

所以我有一个 VM,但 Azure 看不到它。

【问题讨论】:

  • 你的问题在这里是题外话。您可以在Super UserServer Fault 上提问。
  • 我投票结束这个问题,因为这是关于操作系统虚拟机而不是编程。你应该删除这个并在unix.stackexchange.com上提问

标签: linux azure azure-virtual-machine


【解决方案1】:

如果您想释放经典 VM,我们应该在 CLI 1.0 中使用此命令 azure vm shutdown 'vnmane' ASM 模式

jason@Azure:~$ azure config mode asm
info:    Executing command config mode
info:    New mode is asm
info:    config mode command OK
jason@Azure:~$ azure vm shutdown -h
help:    Shutdown the VM
help:
help:    Usage: vm shutdown [options] <name>
help:
help:    Options:
help:      -h, --help               output usage information
help:      -v, --verbose            use verbose output
help:      -vv                      more verbose with debug output
help:      --json                   use json output
help:      -d, --dns-name <name>    only show VMs for this DNS name
help:      -p, --stay-provisioned   if specified the compute resource will not be released on shutdown
help:      -s, --subscription <id>  the subscription id
help:
help:    Current Mode: asm (Azure Service Management)
jason@Azure:~$ azure vm shutdown 'jasonv'
info:    Executing command vm shutdown
+ Getting virtual machines
+ Shutting down VM
info:    vm shutdown command OK
jason@Azure:~$

希望这会有所帮助:)

【讨论】:

  • 您好,在ASM模式下如何增加磁盘容量? azure vm set \ --resource-group myResourceGroup \ --name myVM \ --new-os-disk-size 50
  • @Dhafer Azure CLI 1.0 ASM 模式不支持扩展 OS 磁盘,我们可以使用 Azure powershell (ASM) 命令update-azuredisk -DiskName "jasonvm6063" -Label resized -ResizedSizeInGB 100 来扩展它。目前,Azure cloud shell 不支持 ASM powershell,我们应该在本地 PC 上安装 Azure powershell,然后使用 Powershell 进行扩展。更多关于powershell扩展OS盘的信息,请参考这个link
猜你喜欢
  • 2017-01-15
  • 1970-01-01
  • 1970-01-01
  • 2014-09-09
  • 1970-01-01
  • 2017-07-16
  • 1970-01-01
  • 2017-10-09
  • 1970-01-01
相关资源
最近更新 更多