OpenStack JEOS 镜像

时间:2024-10-08 17:36:32

JEOS:Just Enough Operating System *地址:http://en.wikipedia.org/wiki/Just_enough_operating_system

OpenStack官方文档有介绍Building JEOS images for use with Heat

对于Heat来说,JEOS就是安装有cloud-initheat-cfntools的镜像,这样才能使用Heat全部的功能。

官方给出的方法是用disk-image-create工具,但我比较喜欢在系统里自行安装,然后做成镜像。

cloud-init和heat-cfntools都能执行Heat模板里面用户自定义的脚本

根据字面意思,cloud-init比较通用,比如设置hostname、注入公钥、执行脚本等等;heat-cfntools是封装的更加high level,和heat搭配比较方便。

安装步骤很简单,都有现成的包。对于CentOS 6.x 来说,有以下几步:

1.安装epel源

# yum install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

2.安装cloud-init

# yum install cloud-init

3.修改cloud-init配置/etc/cloud/cloud.cfg

默认有一个centos用户,不允许ssh root登陆并且不允许密码登陆

users:
- default disable_root:
ssh_pwauth: 0

修改为

disable_root: 0
ssh_pwauth: 1

default_user:

system_info:
default_user:
name: centos
distro: rhel
paths:
cloud_dir: /var/lib/cloud
templates_dir: /etc/cloud/templates
ssh_svcname: sshd

4. 修改/etc/ssh/sshd_config

PermitRootLogin yes
PasswordAuthentication yes

5. 安装heat-cfntools

# yum install heat-cfntools

//创建aws软链接,为了和aws兼容
# cfn-create-aws-symlinks

相关文章