如何使用Cloud Shell扩展Linux VM上的操作系统磁盘?

时间:2017-11-30 16:00:13

标签: linux azure azure-virtual-machine

我对生产经典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

所以我有一台虚拟机,但Azure无法看到它。

1 个答案:

答案 0 :(得分:0)

如果要取消分配经典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:~$

希望这会有所帮助:)