openstack创建虚机
由于制作镜像比较麻烦,直接从https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz下了一个回来。
发布镜像
# uec-publish-tarball cirros-0.3.0-x86_64-uec.tar.gz cirr x86_64
WARNING: 'uec-publish-tarball' is now to 'cloud-publish-tarball'. Please update your tools or docs
Thu Jun 28 18:42:11 CST 2012: ====== extracting image ======
kernel : cirros-0.3.0-x86_64-vmlinuz
ramdisk: cirros-0.3.0-x86_64-initrd
image : cirros-0.3.0-x86_64-blank.img
Thu Jun 28 18:42:11 CST 2012: ====== bundle/upload kernel ======
Thu Jun 28 18:42:13 CST 2012: ====== bundle/upload ramdisk ======
Thu Jun 28 18:42:15 CST 2012: ====== bundle/upload image ======
Thu Jun 28 18:42:17 CST 2012: ====== done ======
emi="ami-00000009"; eri="ari-00000008"; eki="aki-00000007";
WARNING: 'uec-publish-tarball' is now to 'cloud-publish-tarball'. Please update your tools or docs
Thu Jun 28 18:42:11 CST 2012: ====== extracting image ======
kernel : cirros-0.3.0-x86_64-vmlinuz
ramdisk: cirros-0.3.0-x86_64-initrd
image : cirros-0.3.0-x86_64-blank.img
Thu Jun 28 18:42:11 CST 2012: ====== bundle/upload kernel ======
Thu Jun 28 18:42:13 CST 2012: ====== bundle/upload ramdisk ======
Thu Jun 28 18:42:15 CST 2012: ====== bundle/upload image ======
Thu Jun 28 18:42:17 CST 2012: ====== done ======
emi="ami-00000009"; eri="ari-00000008"; eki="aki-00000007";
发布的时候要记下emi的值,后面创建虚机需要传入这个参数。
创建虚机
euca-run-instances ami-00000009 -k feisky -t m1.tiny
稍等一会,就可以用nova list或euca-describe-instances看到所创建的虚机变为ACTIVE状态,同时用xm list也可以看到虚机处于运行状态。
虚机创建好之后就可以通过ssh或者控制台连接了:ssh -i mykey.priv root@$ipaddress或xm console instance-00000003