简体   繁体   English

Azure ReservedIP终结点

[英]Azure ReservedIP endpoints

I'm trying to provision a new Azure VM from an image via PowerShell and I need to use ReservedIP (which is why I'm using PowerShell - ReservedIP functionality isn't available from the management portal). 我正在尝试通过PowerShell通过映像配置新的Azure VM,并且需要使用ReservedIP(这就是为什么我使用PowerShell的原因-管理门户不提供ReservedIP功能)。

I'm running the following command: 我正在运行以下命令:

New-AzureVMConfig -Name "myName" -InstanceSize Small -ImageName "imageName" | New-AzureVM -ServiceName "serviceName" -ReservedIPName "IP Name" -AffinityGroup "myAffinityGroup"

But I get the following error: 但是我收到以下错误:

New-AzureVM : BadRequest: Deployment serviceName uses ReservedIP IP Name but does not contain any endpoints. Deployment must contain at least one endpoint in order to use a ReservedIP.

I can see that the cloud instance gets created, but it doesn't have any VM instance in it. 我可以看到创建了云实例,但是其中没有任何VM实例。 Other Stack Overflow posts seem to imply that the above pshell commands should just work. 其他Stack Overflow帖子似乎暗示上述pshell命令应该可以正常工作。 None of the documentation addresses the need to add an endpoint and the VM doesn't even get created, so I don't know where I'd be able to add one. 这些文档都没有解决添加端点的需求,甚至都没有创建VM,因此我不知道可以在哪里添加端点。

Any help would be much appreciated. 任何帮助将非常感激。 Thanks! 谢谢!

Figured it out! 弄清楚了!

You need to add an Add-AzureEndpoint call after New-AzureVMConfig instead of after New-AzureVM . 您需要添加一个Add-AzureEndpoint后调用New-AzureVMConfig代替后New-AzureVM

I wanted to move a machine to a cloud service with a static ip, so I deleted the VM (keeping the disk), then once the disk showed up for use I ran the code below. 我想使用静态IP将计算机移至云服务,所以我删除了VM(保留磁盘),然后一旦磁盘可用,我就运行以下代码。 I know it will have a bogus endpoint that I will have to remove and re-create later. 我知道它将有一个虚假的端点,以后必须删除并重新创建。 I just wanted it to be created. 我只是想要创建它。

New-AzureVMConfig -Name "test" -InstanceSize Large -DiskName "test-test-0-201409031948580187" |Add-AzureEndpoint -Name "test" -Protocol "tcp" -PublicPort 80 -LocalPort 80 -LBSetName "test" -ProbePort 888 -ProbeProtocol "TCP"| New-AzureVMConfig-名称“ test” -InstanceSize大-DiskName“ test-test-0-201409031948580187” | Add-AzureEndpoint-名称“ test”-协议“ tcp” -PublicPort 80 -LocalPort 80 -LBSetName“ test” -ProbePort 888 -ProbeProtocol“ TCP” | New-AzureVM -ServiceName "test" –ReservedIPName "SQL-UAT-USEast" -VNetName "East-1" -Location "East US" New-AzureVM -ServiceName“测试” –ReservedIPName“ SQL-UAT-USEast” -VNetName“ East-1”-位置“ East US”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM