0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

az vm resizeで複数のVMをまとめて実行する方法

Last updated at Posted at 2023-02-10

はじめに

意外と便利なやり方だけど手順が見つけるのに苦労したのでメモ残す

コマンド

あらかじめリソースIDを準備しておくことがコツ。
az vm wait で--upatedで待つのもポイント。

$vm1_id="/subscriptions/2a7080ea-1981-457b-aac9-902be7c5f00d/resourceGroups/pro-nabehiro-001/providers/Microsoft.Compute/virtualMachines/nbfr151v"
$vm2_id="/subscriptions/2a7080ea-1981-457b-aac9-902be7c5f00d/resourceGroups/pro-nabehiro-001/providers/Microsoft.Compute/virtualMachines/nbfr152v"

az vm resize --resource-group pro-nabehiro-001 --name nbfr152v --size Standard_B1ls --no-wait
az vm resize --resource-group pro-nabehiro-001 --name nbfr151v --size Standard_B1ls --no-wait
az vm wait -g pro-nabehiro-001 --updated --ids $vm1_id $vm2_id

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?