Centos上eucalyptus源代码安装(一)
http://running.iteye.com/blog/1107487
Centos上eucalyptus源代码安装(二)
http://running.iteye.com/blog/1109357
Centos上eucalyptus源代码安装(四)-使用Eucalyptus
http://running.iteye.com/blog/1109413
第六步,Eucalyptus镜像管理
1.我们需要根据
上一节,source 下载的 'eucarc' 文件
完成后我们就可以使用 euca2tool 的命令了,如 euca-describe-images 等。此时我们运行此命令后结果为空,因为我们还没有上传并注册任何的镜像文件。
2.下载现成的操作系统镜像文件
http://open.eucalyptus.com/wiki/EucalyptusUserImageCreatorGuide_v1.6
这里我们选择下载centos5.3
euca-centos-5.3-x86_64.tar.gz
3.添加镜像
i.kernel
mkdir -p /data/centOS/v53/xen
euca-bundle-image -d /data1/centOS/v53/xen -i ./euca-centos-5.3-x86_64/xen-kernel/vmlinuz-2.6.27.21-0.1-xen --kernel true
Checking image
Tarring image
Encrypting image
Splitting image...
Part: vmlinuz-2.6.27.21-0.1-xen.part.0
Generating manifest /data1/centOS/v53/xen/vmlinuz-2.6.27.21-0.1-xen.manifest.xml
euca-upload-bundle -b centOS-5.3-xen-again-buckit -m /data/centOS/v53/xen/vmlinuz-2.6.27.21-0.1-xen.manifest.xml
成功以后,命令行输出
Checking bucket: centOS-5.3-xen-again-buckit
Creating bucket: centOS-5.3-xen-again-buckit
Uploading manifest file
Uploading part: vmlinuz-2.6.27.21-0.1-xen.part.0
Uploaded image as centOS-5.3-xen-again-buckit/vmlinuz-2.6.27.21-0.1-xen.manifest.xml
euca-register centOS-5.3-xen-again-buckit/vmlinuz-2.6.27.21-0.1-xen.manifest.xml
IMAGE
eki-067D1873
(set the printed eki to
$EKI) //长传并注册 kernel
ii. ramdisk
euca-bundle-image -d /data/centOS/v53/xen -i ./euca-centos-5.3-x86_64/xen-kernel/initrd-2.6.27.21-0.1-xen --ramdisk true
Checking image
Tarring image
Encrypting image
Splitting image...
Part: initrd-2.6.27.21-0.1-xen.part.0
Generating manifest /data/centOS/v53/xen/initrd-2.6.27.21-0.1-xen.manifest.xml
euca-upload-bundle -b centOS-5.3-xen-again-buckit -m /data/centOS/v53/xen/initrd-2.6.27.21-0.1-xen.manifest.xml
Checking bucket: centOS-5.3-xen-again-buckit
Uploading manifest file
Uploading part: initrd-2.6.27.21-0.1-xen.part.0
Uploaded image as centOS-5.3-xen-again-buckit/initrd-2.6.27.21-0.1-xen.manifest.xml
euca-register centOS-5.3-xen-again-buckit/initrd-2.6.27.21-0.1-xen.manifest.xml
IMAGE
eri-E15A17DF
(set the printed eri to
$ERI) //长传并注册 ramdisk(非必须)
iii. image file
euca-bundle-image -d /data/centOS/v53/xen -i ./euca-centos-5.3-x86_64/centos.5-3.x86-64.img --kernel ${EKI} --ramdisk ${ERI}
Checking image
Tarring image
Encrypting image
Splitting image...
Part: centos.5-3.x86-64.img.part.0
Part: centos.5-3.x86-64.img.part.1
Part: centos.5-3.x86-64.img.part.2
Part: centos.5-3.x86-64.img.part.3
Part: centos.5-3.x86-64.img.part.4
Part: centos.5-3.x86-64.img.part.5
Part: centos.5-3.x86-64.img.part.6
Part: centos.5-3.x86-64.img.part.7
Part: centos.5-3.x86-64.img.part.8
Part: centos.5-3.x86-64.img.part.9
Part: centos.5-3.x86-64.img.part.10
Part: centos.5-3.x86-64.img.part.11
Part: centos.5-3.x86-64.img.part.12
Part: centos.5-3.x86-64.img.part.13
Part: centos.5-3.x86-64.img.part.14
Part: centos.5-3.x86-64.img.part.15
Part: centos.5-3.x86-64.img.part.16
Part: centos.5-3.x86-64.img.part.17
Part: centos.5-3.x86-64.img.part.18
Generating manifest /data/centOS/v53/xen/centos.5-3.x86-64.img.manifest.xml
euca-upload-bundle -b centOS-5.3-xen-again-buckit -m /data/centOS/v53/xen/centos.5-3.x86-64.img.manifest.xml
Checking bucket: centOS-5.3-xen-again-buckit
Uploading manifest file
Uploading part: centos.5-3.x86-64.img.part.0
Uploading part: centos.5-3.x86-64.img.part.1
Uploading part: centos.5-3.x86-64.img.part.2
Uploading part: centos.5-3.x86-64.img.part.3
Uploading part: centos.5-3.x86-64.img.part.4
Uploading part: centos.5-3.x86-64.img.part.5
Uploading part: centos.5-3.x86-64.img.part.6
Uploading part: centos.5-3.x86-64.img.part.7
Uploading part: centos.5-3.x86-64.img.part.8
Uploading part: centos.5-3.x86-64.img.part.9
Uploading part: centos.5-3.x86-64.img.part.10
Uploading part: centos.5-3.x86-64.img.part.11
Uploading part: centos.5-3.x86-64.img.part.12
Uploading part: centos.5-3.x86-64.img.part.13
Uploading part: centos.5-3.x86-64.img.part.14
Uploading part: centos.5-3.x86-64.img.part.15
Uploading part: centos.5-3.x86-64.img.part.16
Uploading part: centos.5-3.x86-64.img.part.17
Uploading part: centos.5-3.x86-64.img.part.18
Uploaded image as centOS-5.3-xen-again-buckit/centos.5-3.x86-64.img.manifest.xml
euca-register centOS-5.3-xen-again-buckit/centos.5-3.x86-64.img.manifest.xml
IMAGE emi-AF6E179A
(set the printed emi to
$EMI)//长传并注册 img
EMI=emi-AF6E179A
备注:其中$EKI 为注册的 kernel ID,$ERI 为注册的 ramdisk ID,$EMI 为注册的 img ID
4.查看镜像
a.上传成功后,我们在 web 界面上就可以看到镜像文件了:
b.前端ncs运行
执行euca-describe-images 命令,会显示如下内容
IMAGE eri-E15A17DF centOS-5.3-xen-again-buckit/initrd-2.6.27.21-0.1-xen.manifest.xml admin available public x86_64 ramdisk instance-store
IMAGE emi-AF6E179A centOS-5.3-xen-again-buckit/centos.5-3.x86-64.img.manifest.xml admin available public x86_64 machine eki-067D1873 eri-E18517E5 instance-store
IMAGE eri-E18517E5 centOS-5.3-xen-again-buckit/initrd-2.6.27.21-0.1-xen.manifest.xml admin available public x86_64 ramdisk instance-store
IMAGE eki-067D1873 centOS-5.3-xen-again-buckit/vmlinuz-2.6.27.21-0.1-xen.manifest.xml admin available public x86_64 kernel instance-store
4.删除镜像
a.必须首先删除镜像
euca-deregister <emi-XXXXXXXX>
b.删除储存在bucket的文件
euca-delete-bundle -a $EC2_ACCESS_KEY -s $EC2_SECRET_KEY --url $S3_URL -b <bucket> -p <file prefix>
如果想删除image 和 bucket,添加'--clear'参数
euca-delete-bundle -a $EC2_ACCESS_KEY -s $EC2_SECRET_KEY --url $S3_URL -b <bucket> -p <file prefix> --clear