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 cli使ってAzure LBに VM を接続/切り離し

Last updated at Posted at 2023-02-12

はじめに

のaz cli版。忘れる前に書く

参考URL

↑↑のサイトのアイデアを参考にして、実際のスクリプトは↓↓を参考にしました。

作業前のスクショ

これからMyAddressPoolにnbfr152vのNICをくっつける
image.png

VMの接続

$rg="pro-nabehiro-002"
$lb="nbfr151x"
$add_pool="MyAddressPool"
$ipc="ipconfignbfr152v"
$nic="nbfr152vVMNic"

az network nic ip-config address-pool add --address-pool $add_pool --ip-config-name $ipc --nic-name $nic --resource-group $rg --lb-name $lb

実行後。
image.png

VMの切り離し

addの部分をremoveにするだけ。

$rg="pro-nabehiro-002"
$lb="nbfr151x"
$add_pool="MyAddressPool"
$ipc="ipconfignbfr152v"
$nic="nbfr152vVMNic"

az network nic ip-config address-pool remove --address-pool $add_pool --ip-config-name $ipc --nic-name $nic --resource-group $rg --lb-name $lb

おわりに

をみると、APGWも同じようにやれるようだ。今度試してみよう

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?