简体   繁体   English

Azure RM端口转发

[英]Azure RM port forwarding

I am testing azure right now and have some problems. 我现在正在测试azure并遇到一些问题。

I am using new Azure portal (Resource manager). 我正在使用新的Azure门户(资源管理器)。 How do I add a static IP to my network and forward ports to different VM's? 如何向网络添加静态IP并将端口转发到不同的VM? Then how do I add a static IP on my "Network Interface"? 那么如何在“网络接口”上添加静态IP?

I can't assign this interface to VM, because it says that only dynamic IP can be assigned, and static IP can only be assigned to load balancer. 我无法将此接口分配给VM,因为它表示只能分配动态IP,而静态IP只能分配给负载均衡器。 I have created load balancer, added static public IP, but then I try to add a Virtual machine and it asks me to define availability set. 我创建了负载均衡器,添加了静态公共IP,但后来我尝试添加虚拟机,它要求我定义可用性集。 But I do not have availability set. 但我没有可用性设置。 So I have created Availability set, but now I cannot add virtual machine to availability set, because PowerShell cmdlet is only for classic VM's, and there is no cmdlet for resource manager VM. 所以我创建了可用性集,但现在我无法将虚拟机添加到可用性集,因为PowerShell cmdlet仅适用于经典VM,并且没有资源管理器VM的cmdlet。

So I have only two questions: How can I add static Public IP in my Azure RM network (so that ip address newer changes) and forward ports to Azure RM VM's in my private network? 所以我只有两个问题:如何在Azure RM网络中添加静态公共IP(以便更新IP地址)并将端口转发到我的专用网络中的Azure RM VM? Because there will be exchange server, web server and I need to forward basic ports to them. 因为会有交换服务器,Web服务器和我需要将基本端口转发给它们。

If answer to previous question is "Load balancer", so how I can move Azure RM VM's to Availability Set? 如果回答上一个问题是“负载均衡器”,那么我如何将Azure RM VM移动到可用性集? Do I have to recreate a Virtual Machine? 我是否必须重新创建虚拟机? That if there is important data? 如果有重要数据?

I have been investigating some aspects of this as I move from Classic VMs (ASM) to ARM. 当我从Classic VMs(ASM)迁移到ARM时,我一直在研究这方面的一些方面。

The documentation isn't clear or very complete, and this being Azure will probably be different in a months time. 文档不清楚或非常完整,这可能是Azure在几个月的时间内会有所不同。 But, today.... 但今天....

A static public IP can only be assigned to a load balancer, not an individual VM. 静态公共IP只能分配给负载均衡器,而不能分配给单个VM。 Search for "Reserved IP Address" in the following article where it states "Static Public IPs can only be assigned to a Load balancer right now.": https://azure.microsoft.com/en-gb/documentation/articles/virtual-machines-azurerm-versus-azuresm/ (EDIT: Noticed that in portal.azure.com there is a switch on each public IP resource to change it from dynamic to static - though I haven't tested this). 在下面的文章中搜索“保留的IP地址”,其中指出“静态公共IP现在只能分配给负载均衡器。”: https//azure.microsoft.com/en-gb/documentation/articles/virtual -machines-azurerm-versus-azuresm / (EDIT:注意到在portal.azure.com中,每个公共IP资源都有一个开关,可以将它从动态更改为静态 - 尽管我没有对此进行测试)。

Port forward definitely requires a load balancer. 端口转发肯定需要负载均衡器。 See the comments at the bottom of this article where I asked this exact question and Microsoft replied confirming this: https://azure.microsoft.com/en-gb/documentation/articles/load-balancer-arm-powershell/ 请参阅本文底部的评论,其中我提出了这个确切的问题,Microsoft回复确认了这一点: https//azure.microsoft.com/en-gb/documentation/articles/load-balancer-arm-powershell/

Basic VMs cannot use a load balancer today: https://azure.microsoft.com/en-gb/pricing/details/load-balancer/ 基本虚拟机今天无法使用负载均衡器: https//azure.microsoft.com/en-gb/pricing/details/load-balancer/

I also read somewhere (can't find the link now) that under a load balancer, there are some restrictions about which machines can be grouped together (based around sizing). 我还读到了某个地方(现在找不到链接),在负载均衡器下,对于哪些机器可以组合在一起(基于大小调整)存在一些限制。 From memory I think A0 to A4 could be grouped for example, then say A5 to A8 could be, but say A0 and A7 couldn't be. 从记忆中我认为A0到A4可以分组为例,然后说A5到A8可能是,但是说A0和A7不可能。

The following page states "Currently with Resource Manager, you can only add a virtual machine to an availability set during its creation.": https://azure.microsoft.com/en-gb/documentation/articles/virtual-machines-ps-create-preconfigure-windows-resource-manager-vms/ If you need an Availability Set, then you may need to delete and recreate the VM. 以下页面指出“目前使用资源管理器,您只能在创建期间将虚拟机添加到可用性集”。: https//azure.microsoft.com/en-gb/documentation/articles/virtual-machines-ps -create-preconfigure-windows-resource-manager-vms /如果需要可用性集,则可能需要删除并重新创建VM。 You should be able to delete the VM but keep the VHDs, then recreate the VM with the existing VHDs so not lose data. 您应该能够删除VM但保留VHD,然后使用现有VHD重新创建VM,以免丢失数据。

As well as the links above, I have also found the following helpful: http://blogs.msdn.com/b/cloud_solution_architect/archive/2015/05/05/creating-azure-vms-with-arm-powershell-cmdlets.aspx http://blogs.technet.com/b/parallel_universe_-_ms_tech_blog/archive/2015/11/04/deploy-a-vm-with-azure-powershell-preview-1-0-cmdlets.aspx 除了上面的链接,我还发现以下内容: http//blogs.msdn.com/b/cloud_solution_architect/archive/2015/05/05/creating-azure-vms-with-arm-powershell-cmdlets .aspx http://blogs.technet.com/b/parallel_universe_-_ms_tech_blog/archive/2015/11/04/deploy-a-vm-with-azure-powershell-preview-1-0-cmdlets.aspx

Hope that helps. 希望有所帮助。

Chris 克里斯

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

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