[英]Fail to assign a Dynamic IP to my Vm due to Availability Zone Constraint
I wanted to change my Static Public IP into a Dynamic one in order to reduce cost.我想将我的 Static Public IP 更改为动态的,以降低成本。 So i deleted the Static IP and created a new one with Dynamic allocation.
所以我删除了 Static IP 并创建了一个新的动态分配。 So far so good.
到目前为止,一切都很好。 The thing now is that when i try to assign the public IP to my VM i get this error
现在的问题是,当我尝试将公共 IP 分配给我的 VM 时,我收到此错误
Failed to save IP address changes for network interface 'deployment1477'. Error: Compute resource deployment1 has a zone constraint 1 but the PublicIPAddress deployment_ip used by the compute resource via NetworkInterface or LoadBalancer has a different zone constraint Regional.
What i found is that my VM has a availability zone constraint.我发现我的虚拟机有一个可用区限制。 It's not the Region, but it's the availability zone which is set to 1. I couldn't find an easy way to just change that setting somehow.
这不是区域,而是设置为 1 的可用区。我找不到一种简单的方法来以某种方式更改该设置。 So as of now i cannot assign a dynamic Public IP address to my VM.
所以到目前为止,我无法为我的虚拟机分配动态公共 IP 地址。
Here is a screenshot of what i mean by availability zone constraint which could be found in the Overview (main page) page of your VM:这是我所说的可用区约束的屏幕截图,可以在 VM 的概述(主页)页面中找到:
At the very base, you need to understand the difference between a regional service and a zone-redundant service.从根本上讲,您需要了解区域服务和区域冗余服务之间的区别。 An Azure Basic Public IP is a
regional service
. Azure 基本公共 IP 是
regional service
。 That means if you create an IP address, it can be taken from ANY Data Center within a specific region.这意味着如果您创建一个 IP 地址,它可以从特定区域内的任何数据中心获取。
A Standard SKU Public IP is a zone-redundant service, which means that the service will only exist in the specified zones, replicating across each other, to ensure availability of your services if one zone is unavailable.标准 SKU 公共 IP 是一种区域冗余服务,这意味着该服务将仅存在于指定区域中,相互复制,以确保在一个区域不可用时您的服务可用。
This link explains the terminologies and also public IP SKU specifications. 此链接解释了术语以及公共 IP SKU 规范。 Extract below:
摘录如下:
Basic SKU: If you are creating a public IP address in a region that supports availability zones, the Availability zone setting is set to None by default.
基本 SKU:如果您在支持可用区的区域中创建公共 IP 地址,则可用区设置默认设置为无。 Basic Public IPs do not support Availability zones.
基本公共 IP 不支持可用区。 Standard SKU: A Standard SKU public IP can be associated to a virtual machine or a load balancer front end.
标准 SKU:标准 SKU 公共 IP 可以关联到虚拟机或负载均衡器前端。 If you're creating a public IP address in a region that supports availability zones, the Availability zone setting is set to Zone-redundant by default.
如果您在支持可用区的区域中创建公共 IP 地址,则可用区设置默认设置为 Zone-redundant。
So here, your VM belongs to an availability zone, but the Basic IP address does not belong to a specific zone but to a region instead.所以在这里,你的虚拟机属于一个可用区,但是基本的 IP 地址不属于特定的区域,而是属于一个区域。
This is why the error says: ...Compute resource deployment1 has a zone constraint 1...
and the PublicIPAddress deployment_ip...has a different zone constraint Regional.
这就是错误提示的原因:
...Compute resource deployment1 has a zone constraint 1...
并且the PublicIPAddress deployment_ip...has a different zone constraint Regional.
This Azure Documentation provides all limitations of public IP addresses. 此Azure 文档提供了公共 IP 地址的所有限制。
You need to access the VM (or an application on the VM) through the Public IP.您需要通过公共 IP 访问 VM(或 VM 上的应用程序)。
Use a Basic Load Balancer , with a Basic SKU IP, to route traffic to the VM but also provide Source NAT for outbound connection .使用带有基本 SKU IP 的基本负载均衡器将流量路由到虚拟机,同时为出站连接提供源 NAT 。 Azure Basic Load Balancer is free.
Azure 基本负载均衡器是免费的。 Standard Load Balancers require additional configuration for SNAT setup.
标准负载均衡器需要对 SNAT 设置进行额外配置。
Backend Pool Configuration
, use the VM's private IP address.Backend Pool Configuration
,而是使用 VM 的私有 IP 地址。3389
, or Port 80
).3389
或端口80
)上路由流量。OS disk
(and Data disks
if applicable) from the VM.OS disk
(和Data disks
,如果适用)。Basic SKU
public IP address and Dynamic Allocation
mode.Basic SKU
公共 IP 地址和Dynamic Allocation
模式创建一个您不会放入可用区的新 VM。Disks
tab and go for Swap OS disk
while specifying the OS disk from the original VM.Disks
选项卡和 go 以换取Swap OS disk
,同时从原始 VM 指定操作系统磁盘。 An alternative (proper but more complex) to Option 2 would be to take a Snapshot of the OS disk, and then when you're on the Snapshot, Create disk
, then from the disk - Create VM
, and parse all the VM parameters.选项 2 的替代方法(适当但更复杂)是拍摄 OS 磁盘的快照,然后当您在快照上时,
Create disk
,然后从磁盘 - Create VM
,并解析所有 VM 参数。
The VM only needs outbound internet access and you do not need to remote in or access an application through its public IP. VM 只需要出站 Internet 访问,您不需要通过其公共 IP 远程访问或访问应用程序。
You can just get rid of the public IP address.您可以摆脱公共 IP 地址。 All VMs in Azure have internet access by default.
Azure 中的所有虚拟机默认都可以访问互联网。 Couldn't find a Microsoft Document on it but here's someone else mentioning it .
在上面找不到 Microsoft 文档,但这里有人提到它。
You will often encounter a lot of complex/frustrating scenarios when working with some Azure products.在使用一些 Azure 产品时,您经常会遇到很多复杂/令人沮丧的情况。 It's always evolving hence you should always take a look at current limitations to see whether a setup fits your scenario.
它一直在发展,因此您应该始终查看当前的限制,以查看设置是否适合您的场景。 There are simple issues which have been raised more than 5 years ago that are still unresolved.
有一些简单的问题在 5 年多前就已经提出,但仍未解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.