自动化kolla-ansible部署ubuntu20.04+openstack-victoria之镜像制作debian9.6.0-17
阅读原文时间:2021年12月31日阅读:1

自动化kolla-ansible部署ubuntu20.04+openstack-victoria之镜像制作debian9.6.0-17

欢迎加QQ群:1026880196 进行交流学习

制作OpenStack Debian9.6.0 64位镜像

1. 打开虚拟系统管理器 位置:应用程序->系统工具->虚拟系统管理器

2. 安装系统选择英文默认一步步安装,分区 自定义分区  3G  全部分配给/         #图形操作与ubuntu类似可以参考自动化kolla-ansible部署ubuntu20.04+openstack-victoria之镜像制作ubuntu16.04-16

3. 选择网络阿里源源安装

4. 删除debian用户

userdel -r debian

5.  配置阿里更新源
cp /etc/apt/sources.list /etc/apt/sources.list.bak
#备份
 vim /etc/apt/sources.list #修改
全部删除 添加如下:

deb http://mirrors.aliyun.com/debian stretch main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free
deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free

6. 更新列表

apt-get update

-----------------------------------------------------------------------------------------------------------------
#如要用于其他版本,把
jessie换成版本代号就好:

debian7 - wheezy
debian8 - jessie
debian9 - stretch
debian10 -
buster

-----------------------------------------------------------------------------------------------------------------

7. 修改时区
tzselect

选择5   9     1     1

8. 安装常用工具

apt install qemu-guest-agent openssh-server bash-completion ntpdate sysstat sudo vim ntp -y

9. 安装cloud-init

apt-get install cloud-init cloud-utils parted cloud-initramfs-growroot -y

10. 配置 配置一下:vim /etc/cloud/cloud.cfg 允许root用户登录

disable_root : false

11. 修改配置文件vim /etc/cloud/cloud.cfg ,在cloud_init_modules 下面增加:

- resolv-conf

12. 然后,查看一下iptables:
root@ubuntu:~#
iptables -L
[sudo] password for trait:
Chain INPUT (policy
ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source              
destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source              
destination

如果不是这样:rm -rf /etc/udev/rules.d/*.rules 删除规则文件。

13. 让实例启动带日志
修改允许启动时console访问输出
vim  /etc/default/grub

GRUB_TIMEOUT=1
GRUB_CMDLINE_LINUX="console=ttyS0,115200n8"

运行update-grub命令更新

14.  清理历史记录和日志文件

apt clean all
history -c

15. 关机

poweroff

#kvm 下操作
16. 查看kvm所有虚拟机

virsh list --all

17. 删除系统mac硬件信息

virt-sysprep -d Debian_Stretch_9.6.0_64bit

18. 压缩虚拟机

cd kvm/img/
virt-sparsify --compress /var/lib/libvirt/images/Debian_Stretch_9.6.0_64bit.qcow2 Debian_Stretch_9.6.0_64bit.qcow2

19. 拷贝镜像到controller1上  123456

cd
scp -p kvm/img/Debian_Stretch_9.6.0_64bit.qcow2 192.168.1.50:/root

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章