Eucalyptus マシンイメージ登録　EuStore編

# 背景
最近はOpenStackですが、Eucalyptusも運用してて、最新の日本語テキストも少ないので状況を紹介。

# 問題
クラウド用インスタンスに使われる、軽量ubuntuのCirrOSがOpenStackにありますが、
Eucalyptusの公式にもありますので、試してみました。

# 解法
Eucalyptusの公式マシンイメージは、EuStoreで提供されています。
複数あるEucalyptusのマシンイメージ登録方法では一番手っ取り早いやり方です。
実行環境は、Eucalyptus3.4のclcマシンのコンソール上です。
また、Euca2oolsが実行できる環境である必要があります。

```bash:Euca2ools環境の読み込み
$ . .euca/eucarc
```

```bash:EuStoreのマシンイメージ検索
$ eustore-describeimages
```

```bash:マシンイメージの登録
$ eustore-install-image -b [バケット名] -i [イメージID] --hypervisor kvm
```

```bash:登録状況の確認
$ euca-describe-images | grep [バケット名]
```

# 詳細
実際に試した状況を紹介します。なお名称や値は各自の環境で異なります。

```bash:EuStoreのマシンイメージ検索
$ eustore-describeimages
1190308149      fedora  x86_64  starter kvm     Fedora 17 1.6GB root - Hypervisor-Specific Kernel, 3.9.8-100.fc17 kernel version; cloud-init enabled, ec2-user enabled, sudo rights; Selinux Enabled; euca2ools 2.1.3 installed
2714641871      fedora  x86_64  starter kvm     Fedora 18 1.7GB root - Hypervisor-Specific Kernel, 3.9.6-200.fc18 kernel version; cloud-init enabled, ec2-user enabled, sudo rights; Selinux Enabled; euca2ools 2.1.3 installed
1483421470      centos  x86_64  training        xen,kvm,vmware  Training Use Only - CentOS 5 1.3GB root, Hypervisor-Specific Kernels
2130260817      centos  x86_64  starter kvm     CentOS 5.9 1.4GB root, Hypervisor-Specific Kernel; 2.6.18-348.6.1.el5 kernel version; ec2-user enabled, sudo rights; Selinux Enabled; euca2ools 2.1.3 installed
2627913094      centos  x86_64  starter kvm     CentOS 5.9 1.4GB root, Hypervisor-Specific Kernel; 2.6.18-348.6.1.el5 kernel version; root user enabled; Selinux Enabled; euca2ools 2.1.3 installed
3471904862      centos  x86_64  starter kvm     CentOS 6.4 1.8GB root, Hypervisor-Specific Kernel; 2.6.32-358.11.1.el6.x86_64 kernel version; ec2-user enabled, sudo rights; Selinux enabled; euca2ools 3.0.0 installed
3550541955      debian  x86_64  starter kvm     Debian 7 1.7GB root - Hypervisor-Specific Kernel, 3.9-1-amd64 kernel version; cloud-init enabled, ec2-user enabled, sudo rights; Apparmor enabled; euca2ools 2.1.3 installed
1424900416      opensuse        x86_64  starter kvm     OpenSUSE 12.2 x86_64 - KVM image. SUSE Firewall off. Root disk of 2.5G. Root user enabled. Working with kexec kernel and ramdisk. OpenSUSE minimal base package set..
3106602613      ubuntu  x86_64  partner kvm     Stackato MicroCloud v2.6.6 - KVM Image. Cloud-init enabled. Root disk of 8.8G. For more information, please visit here: http://docs.stackato.com/index.html
4001243952      cirros  x86_64  experimental-images     kvm     CirrOS x86-64, Tiny image used for testing - root user login
1765979475      cirros  i386    experimental-images     kvm     CirrOS i386, Tiny image used for testing - cirros user login
0300949733      cirros  x86_64  experimental-images     kvm     CirrOS x86_64, Tiny image used for testing - cirros user login
```

```bash:マシンイメージの登録
$ eustore-install-image -b cirros-testbucket -i 4001243952 --hypervisor kvm
-- Uploading kernel image --
cirros-0.3.0-x86_64-vmlinuz.part.0 100% |============================================================================|   4.46 MB  28.70 MB/s Time: 0:00:00
cirros-0.3.0-x86_64-vmlinuz.manifest.xml 100% |======================================================================|   3.40 kB  18.03 kB/s Time: 0:00:00
Registered kernel image eki-B4393A07
Extracting image   100% |============================================================================================|  24.00 MB  86.85 MB/s Time: 0:00:00
Bundling image     100% |============================================================================================|  24.00 MB 110.40 MB/s Time: 0:00:00
-- Uploading machine image --
cirros-0.3.0-x86_64-blank.img.part.0 100% |==========================================================================|  27.39 kB 211.24 kB/s Time: 0:00:00
cirros-0.3.0-x86_64-blank.img.manifest.xml 100% |====================================================================|   3.39 kB  28.41 kB/s Time: 0:00:00
Registered machine image emi-E43A3A57
-- Done --
Installed new image emi-E43A3A57
```

```bash:登録状況の確認
$ euca-describe-images | grep cirros-testbucket
IMAGE   eki-B4393A07    cirros-testbucket/cirros-0.3.0-x86_64-vmlinuz.manifest.xml      644187621722    available       private x86_64  kernel           instance-store
IMAGE   emi-E43A3A57    cirros-testbucket/cirros-0.3.0-x86_64-blank.img.manifest.xml    644187621722    available       private x86_64  machine eki-B4393A07      eri-244637DB            instance-store  paravirtualized
IMAGE   eri-244637DB    cirros-testbucket/cirros-0.3.0-x86_64-initrd.manifest.xml       644187621722    available       private x86_64  ramdisk          instance-store
```

# 参考リンク
[Eucalyptus公式ドキュメント](https://www.eucalyptus.com/docs/eucalyptus/3.4/index.html#image-guide/ig_task_eustore.html "Browse and Install Images from EuStore")