简体   繁体   English

Amazon EC2 centos 6竞价型实例根卷

[英]Amazon ec2 centos 6 spot instance root volume

The issue I have is that the root volume on centos AMIs seems to be set to 8GB regardless of what it says in the management console. 我遇到的问题是,无论在管理控制台中说什么,centos AMI上的根卷似乎都设置为8GB。

There are many posts online regarding re-partitioning and rebooting, though the instances need to be provisioned with Ansible and be available as spot instances. 在线上有很多有关重新分区和重新启动的帖子,尽管需要为实例配置Ansible并作为竞价型实例使用。

NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvde    202:64   0  40G  0 disk 
└─xvde1 202:65   0   8G  0 part /

Is there a way to reconfigure without rebooting or starting the instance with the correct partition? 有没有一种方法可以重新配置,而无需重新启动或使用正确的分区启动实例?

[root@ip-172-XX-XX-70 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvde1      7.9G  797M  6.7G  11% /
tmpfs            15G     0   15G   0% /dev/shm


[root@ip-172-XX-XX-70 ~]# resize2fs /dev/xvde1
resize2fs 1.41.12 (17-May-2010)  
The filesystem is already 2096896 blocks long.  Nothing to do!

Many thanks 非常感谢

I'm no Linux partition expert but there are a couple of possible workarounds I would use. 我不是Linux分区专家,但是有几种可能的解决方法。

1) create a custom ami, to do this launch an instance in the normal way, correct the partition size, take a snapshot. 1)创建一个自定义ami,为此以正常方式启动实例,更正分区大小,拍摄快照。 You can then use this AMI instead of the CentOS one you're currently using (also helpful if you want to do things like pre install programs) it does mean you'd still be stuck with a static partition size, depends on your use case if that's an issue. 然后,您可以使用此AMI而不是当前使用的CentOS(这对您要执行诸如预安装程序之类的操作也很有帮助),这确实意味着您仍然会停留在静态分区大小上,具体取决于您的用例如果那是一个问题。

2) use an official AMI, I dont have the full list, or what exactly it is that makes them different but you'll find certain official AMIs, amazon Linux, rhel, windows off the top of my head automatically start with the corrected disk size, if you can move to amazon Linux for example which I believe is a very close fork of centos (at a guess), problem solved. 2)使用正式的AMI,我没有完整的列表,或者究竟是什么使它们与众不同,但是您会发现某些正式的AMI,Amazon Linux,rhel,我头上的窗户会自动从更正后的磁盘开始大小,例如,如果您可以迁移到Amazon Linux(我相信这是centos的一个非常紧密的分支(猜测)),那么问题就解决了。

Good Luck 祝好运

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

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