centos atomic host安装完成会,第一次启动时会调用cloud-init等服务。这是个什么东东?

cloud-init用于在创建虚拟机时通过元数据服务对虚拟机基本配置,包括常见的主机名,用户,密码等等。cloud-init会在启动的过程中分四个阶段运行,按照时间顺序分为:

  1. cloud-init-local
  2. cloud-init
  3. cloud-config
  4. cloud-final

控制cloud-init配置行为的方式有两种:cloudinit的配置文件(/etc/cloud/cloud.cfg)和数据源(如openstack及ec2中的userdata)

系统安装时我禁用cloud-init,以下就是atomic的cloud-init本地配置文件

# cat cloud.cfg
users:
- default disable_root: 1 # 禁用root远程登录
ssh_pwauth: 0 # 禁用ssh密码认证, 改为1 locale_configfile: /etc/sysconfig/i18n
mount_default_fields: [~, ~, 'auto', 'defaults,nofail', '0', '2']
resize_rootfs_tmp: /dev
ssh_deletekeys: 0
ssh_genkeytypes: ~
syslog_fix_perms: ~ cloud_init_modules:
- migrator
- bootcmd
- write-files
- growpart
- resizefs
- set_hostname
- update_hostname
- update_etc_hosts
- rsyslog
- users-groups
- ssh cloud_config_modules:
- mounts
- locale
- set-passwords
- yum-add-repo
- package-update-upgrade-install
- timezone
- puppet
- chef
- salt-minion
- mcollective
- disable-ec2-metadata
- runcmd cloud_final_modules:
- rightscale_userdata
- scripts-per-once
- scripts-per-boot
- scripts-per-instance
- scripts-user
- ssh-authkey-fingerprints
- keys-to-console
- phone-home
- final-message system_info:
default_user:
name: centos
lock_passwd: true # centos用户被锁密码,改为false
passwd: $6$MySalt$0jzR1u/sSfVjQ2h6Udn4reCOEjj9/.pVHfAp7bWDoUd7cfi0GYsFqn9EL9a2MQP4sMZoVOlX4UeGKVUbwYE/N. #增加:设置密码
gecos: Cloud User
groups: [wheel, adm, systemd-journal]
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /bin/bash
distro: rhel
paths:
cloud_dir: /var/lib/cloud
templates_dir: /etc/cloud/templates
ssh_svcname: sshd # vim:syntax=yaml

centos atomic host第一次启动的更多相关文章

  1. docker容器服务器 - centos atomic host

    https://blog.inovex.de/docker-a-comparison-of-minimalistic-operating-systems https://github.com/rvyk ...

  2. 制作centos的U盘启动盘

    制作centos的U盘启动盘比ubuntu麻烦一些,因为可能涉及到fat32文件格式不支持大于4G的文件存储的问题,而最新版本的centos就是大于4G的,所以就需要对U盘进行分区. 一个做主引导,一 ...

  3. ef第一次启动较慢

    解决ef第一次启动较慢的问题: protected void Application_Start() { //禁用第一次ef查询对表__MigrationHistory的问题使用了ef的Code fi ...

  4. centos设置服务开机启动

    Linux CentOS设置服务开机启动的方法 by 天涯 · 2013/07/26 CentOS设置服务开机启动的两种方法 1.利用 chkconfig 来配置启动级别 在CentOS或者RedHa ...

  5. 使用OUYA第一次启动OUYA

    使用OUYA第一次启动OUYA 1.4  使用OUYA 初次使用OUYA时,其启动以后的设置过程耗时较长,也比较繁琐,因此本节将会对其做个详细介绍,让读者的使用过程更加顺利些!好的开端总归是一个不错的 ...

  6. CentOS设置服务开机启动的方法

    CentOS设置服务开机启动的两种方法 1.利用 chkconfig 来配置启动级别在CentOS或者RedHat其他系统下,如果是后面安装的服务,如httpd.mysqld.postfix等,安装后 ...

  7. freshStartTail 第一次启动时 抛弃旧的日志

    freshStartTail [on/off] (requires v8.18.0+) Default: off This is used to tell rsyslog to seek to the ...

  8. 判断ios是app第一次启动

    首次运行的应用程序加入一些help 或者 宣传动画 现在变的很重要了. 一个有用的例子是发送一个分析实例.这可能是一个很好的方法来确定有多少人下载实用应用程序.有人会说:“但是,嘿,苹果AppStor ...

  9. iOS开发——判断是否第一次启动

    在我们做项目的时候,判断是否是第一次启动,还是比较常用的,比如,欢迎界面,只是第一次启动需要的调查问卷等等,目的明确,方法很多,这里介绍一种简单的. 在你需要只有第一次启动才跳转的地方写上 if(![ ...

随机推荐

  1. Unable to locate Android SDK used by project

    Unable to locate Android SDK used by project: DJIgojava.lang.RuntimeException: Unable to locate Andr ...

  2. [物理学与PDEs]书中一些对数学研究有用的引理

    P 35--38 1.  若 ${\bf B}$ 为横场 ($\Div{\bf B}=0\ra {\bf k}\cdot {\bf B}=0\ra $ 波的振动方向与传播方向平行), 则 $$\bex ...

  3. python 正则表达式 demo

    1.匹配大小写和数字,并且大小写数字均要有,且字符串长度为6~20位 ^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z\d]{6,20}$ import repattern ...

  4. ice介绍 z

    什么是ICE(Internet Communications Engine)呢,它是由Zeroc公司开 发的一套开源中间件系统,与DCOM,CORBA,WEB SERVICEDcom类似,支持RPC( ...

  5. git重写历史记录

    1 修改上一次历史提交,替换掉上次的提交git commit --amend 2 git rebase 将不同分支路径合并到同一分支路径上eg:将master分支上的 conflic rebase合并 ...

  6. [Java] 读写字符串数据

    package test.stream; import java.io.FileInputStream; import java.io.FileNotFoundException; import ja ...

  7. [kuangbin带你飞]专题九 连通图

        ID Origin Title   76 / 163 Problem A POJ 1236 Network of Schools   59 / 177 Problem B UVA 315 Ne ...

  8. (medium)LeetCode 264.Ugly Number II

    Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors ...

  9. UIApplication及UIWindow

    *:first-child { margin-top: 0 !important; } body > *:last-child { margin-bottom: 0 !important; } ...

  10. 移植ok6410

    tftp u-boot.bin http://blog.csdn.net/link_hui/article/details/5593518 LED driver http://blog.csdn.ne ...