Update: Centos 6 instance failed to start in the Hong Kong region, stuck in status checks. (maybe network-scripts problem, will check it in future)
Centos 6 only can launch through AMI marketplace, and it’s restricted in certain regions, Hong Kong region can not launch it on a small type of instance, only works on i3.large or bigger, $0.206/hr.
We can launch a centos 6 instance in another region like Singapore, and delete the marketplace code in the default disk /dev/sda1, replace it with a new ebs disk.
- Launch a new centos 6 instance in Singapore or another region. (do not launch it in Hong Kong, too big and have problems)
- Create a new same size of EBS volume, 8G, and then attach it on the centos 6 instance, name it as “/dev/xvdj”
- SSH into your centos instance, formate the xvdj volume.
- $ mkfs -t ext4 /dev/xvdj
- Copy root volume to xvdj
- $ dd bs=128k if=/dev/xvda of=/dev/xvdj
- Shutdown the instance after complete
- Detach the two volumes together, and attach the xvdj as the root volume “dev/sda1”.
- Start the centos instance and check its success.
- Create an AMI for centos 6 instance, and then copy the ami to Hong Kong region.
- Launch a new centos 6 instance with copied AMI.