如何将EC2实例移至其他子网? [英] How can I move EC2 instances to a different subnet?

查看:159
本文介绍了如何将EC2实例移至其他子网?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在AWS中设置了VPC。
我们创建了2个子网(A / 24和B / 24),直接使用所有没有IP /子网的IP进行进一步使用。



b / 24未被完全利用,我们在浪费Ip地址。



现在,我们要减小子网大小并将实例从B / 24中移出至A / 24。并从B / 24和/ 28范围创建4个较小的子网,然后将服务器移回到所创建的较小子网之一。



请告知建议的最佳做法是什么我们可以采用某种方式申请,使我们应该能够将可用的服务器保留在B / 24中,并创建多个子网。

解决方案

创建较小的子网非常简单。删除子网并创建新的子网。但是,您需要先删除B / 24中的框,然后再删除它。



现在,无法在子网之间移动正在运行的计算机*。根据您的应用程序和您的要求,我想先将其关闭,对计算机进行映像,然后在另一个子网中启动该计算机的新实例。



<顺便说一句,我想知道您是否可以从新子网中连接一个新的网络接口,然后删除旧的网络接口,从而有效地移动子网而又无需拆箱。事实证明,您不能删除索引0处的网络接口,这意味着它不起作用。


I have a VPC set up in AWS. we have created 2 subnets (A/24 and B/24), straight using all the IP having no IP's/Subnets for further usage.

We find that the b/24 is not totally utilized and we are wasting the Ip address in that.

Now we want to reduce the subnet size and move the instances from B/24 to A/24. and create 4 smaller subnets from B/24 and of /28 range and move back the servers to one of the smaller subnets created.

Please advise what are the suggested best practices we can apply in a way that we should be able to keep our available servers in B/24 and create multiple subnets as well.

解决方案

Creating smaller subnets is pretty straight forward. Delete the subnet and create new subnets. However, you'll want to transition off the boxes in B/24 before you delete it.

Now, moving a running machine between subnets is not possible*. Depending on your application and your requirements, I imagine that shutting it down, taking an image of the machine, then launching a new instance of that machine in the other subnet will work.

*As an aside, I wondered if you could attach a new network interface from a new subnet and then remove your old network interface, effectively moving subnets without having the take the box down. As it turns out, you cannot remove the network interface at index 0, which means this does not work.

这篇关于如何将EC2实例移至其他子网?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆