LoginSignup
5
4

More than 5 years have passed since last update.

Azure PowerShell で Reserved IPを設定

Last updated at Posted at 2015-08-29

ILPIP(Instance Level Public IP)

ILPIP : サービスではなく仮想マシンに直接グローバルIPを割り当てる。
問題点:仮想マシンを再起動する度には変更されてしまう。
ILPIPに後述の予約済みIPは利用できない

予約済みIP(Reserved IP)を使用する

予約済みIP : Azureで利用できる固定のグローバルIP
仮想マシンインスタンスが存在するサービスに予約済みIP(=固定IP)を割り振る。

  • 予約済みIPの取得
> New-AzureReservedIP -ReservedIPName "IPアドレスの名前" -Label "ラベル名" -Location "East Asia"
  • 確認
> Get-AzureReservedIP
  • サービスへ適用 サービスへ適用したところ以下のエラーが発生。
> Set-AzureReservedIPAssociation -ReservedIPName "予約済みIPの名前" -ServiceName "サービス名"
Set-AzureReservedIPAssociation : BadRequest: The region "予約IPの名前" specified for the reserved ip asiaeast is different than the region
 japaneast that hosted service japaneast belongs to, they need to belong to the same region.

予約済みのIPとサービスを同じリージョンにしないといけないらしい。
一旦、予約済みIPを削除。

> Remove-AzureReservedIP -ReservedIPName "予約IPの名前"

以下のダイアログが表示されたので「はい」を選択

東アジアはおそらく香港。東日本で再作成。

> New-AzureReservedIP -ReservedIPName "予約済みIPの名前" -Label "ラベル名" -Location "Japan East"
> Set-AzureReservedIPAssociation -ReservedIPName "予約済みIPの名前" -ServiceName "サービス名" 

OperationDescription                        OperationId                                 OperationStatus                           
--------------------                        -----------                                 ---------------                           
Set-AzureReservedIPAssociation           xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx        Succeeded                                 

今度はエラーが発生しなかった。

digコマンドで名前解決をしたところうまくいっているようだ。

ただし、

サービス内の仮想マシンが全て停止しているときは予約済みIPに対して課金が発生する($0.41/時 ~306円/月 2015/08/21時点)

参考

5
4
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
5
4