powershell 使用静态IP创建Azure VM

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell 使用静态IP创建Azure VM相关的知识,希望对你有一定的参考价值。

# First an Azure subscription needs to be selected
# https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/
# https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-reserved-public-ip/#how-to-associate-a-reserved-ip-to-a-running-deployment
# This one is just for reading, it's not for a static IP (but can be used for azure powershell setup)
# https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-instance-level-public-ip/

# After that a reserved IP needs to be created
New-AzurereservedIP -ReservedIpName "SomeNameIp01" -Label "SomeNameIp01" -Location "North Europe"

# After that this is used to create a VM
New-AzureVMConfig -Name "SomeVMName" -InstanceSize "Medium" -imagename $portalimage.ImageName | Add-AzureProvisioningConfig -Windows -AdminUsername "someUsername" -Password "somePassword" | New-AzureVM -ServiceName NovArgus -Location "North Europe"

# Reserve IP
Set-AzureReservedIPAssociation -ReservedIPName NovListenerIp01 -ServiceName NovArgus

# Check usage
Get-AzureReservedIP

以上是关于powershell 使用静态IP创建Azure VM的主要内容,如果未能解决你的问题,请参考以下文章