Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6814870
  • 博文数量: 1662
  • 博客积分: 16831
  • 博客等级: 上将
  • 技术积分: 12554
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-25 07:23
个人简介

柔中带刚,刚中带柔,淫荡中富含柔和,刚猛中荡漾风骚,无坚不摧,无孔不入!

文章分类

全部博文(1662)

文章存档

2021年(8)

2020年(24)

2019年(4)

2018年(19)

2017年(66)

2016年(60)

2015年(49)

2014年(201)

2013年(221)

2012年(638)

2011年(372)

分类:

2012-07-17 10:24:24

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.下载现成的操作系统镜像文件

这里我们选择下载centos5.3
euca-centos-5.3-x86_64.tar.gz

3.添加镜像
i.kernel
Java代码 复制代码 收藏代码
  1. mkdir -p /data/centOS/v53/xen   
  2. 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  
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


Java代码 复制代码 收藏代码
  1. 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  
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


Java代码 复制代码 收藏代码
  1. euca-register 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
Java代码 复制代码 收藏代码
  1. 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  
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

Java代码 复制代码 收藏代码
  1. 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  
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
Java代码 复制代码 收藏代码
  1. euca-register 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
Java代码 复制代码 收藏代码
  1. 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}  
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

Java代码 复制代码 收藏代码
  1. euca-upload-bundle -b centOS-5.3-xen-again-buckit -m /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

Java代码 复制代码 收藏代码
  1. euca-register 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
Java代码 复制代码 收藏代码
  1. EMI=emi-AF6E179A  
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.必须首先删除镜像
Java代码 复制代码 收藏代码
  1. euca-deregister   
euca-deregister
b.删除储存在bucket的文件
Java代码 复制代码 收藏代码
  1. euca-delete-bundle -a $EC2_ACCESS_KEY -s $EC2_SECRET_KEY --url $S3_URL -b  -p   
euca-delete-bundle -a $EC2_ACCESS_KEY -s $EC2_SECRET_KEY --url $S3_URL -b -p
如果想删除image 和 bucket,添加'--clear'参数
Java代码 复制代码 收藏代码
  1. euca-delete-bundle -a $EC2_ACCESS_KEY -s $EC2_SECRET_KEY --url $S3_URL -b  -p  --clear  
阅读(229) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~