linux oz制作镜像,oz制作qcow2镜像

oz是一个方便制作qcow2镜像的工具,利用oz可以很方便的生成可以upload到openstack的镜像!

ks.cfg

===================================

#platform=x86, AMD64, or Intel EM64T

#version=DEVEL

# Install OS instead of upgrade

install

# Keyboard layouts

keyboard ‘us’# Reboot after installation

reboot

# Root password

rootpw –iscrypted $1$jcIF8/Hh$hHIaOjg4owNnuO6Iq4D8h/

# System timezone

timezone Asia/Shanghai

# System language

lang en_US

# Firewall configuration

firewall –disabled

# Network information

network –bootproto=dhcp –device=eth0 –onboot=on

# System authorization information

auth –useshadow –passalgo=sha512

# Use CDROM installation media

cdrom

# Use graphical install

graphical

# SELinux configuration

selinux –disabled

# Do not configure the X Window System

skipx

# System bootloader configuration

bootloader –append=”rhgb crashkernel=auto quiet” –location=mbr

#bootloader –append=”console=ttyS0,115200n8 console=tty0″ –location=mbr –driveorder=”sda” –timeout=1

# Clear the Master Boot Record

zerombr

# Partition clearing information

clearpart –all –initlabel

# Disk partitioning information

part /boot –fstype=”ext4″ –size=200

part / –fstype=”ext4″ –size=512 –grow

%packages –nobase

%end

%post

cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF DEVICE="eth0" BOOTPROTO="dhcp" ONBOOT="yes" TYPE="Ethernet" USERCTL="yes" PEERDNS="yes" IPV6INIT="no" PERSISTENT_DHCLIENT="1" EOF echo -e 'cloud-user\tALL=(ALL)\tNOPASSWD: ALL' >> /etc/sudoers

rm -f /etc/udev/rules.d/70-persistent-net.rules

%end

===================================

centos62.tdl

+++++++++++++++++++++++++++++++++++

++++++++++++++++++++++++++++++++++++

确保libvirtd.service和libvirt-guests.service启动!不然会出错,如果出现user,group xxxxx uid 107等错误!修改/etc/nsswitch.conf,把一下三行注释掉:

======================

passwd: files sss

shadow: files sss

group: files sss

======================

制作过程中,如果出现,guest.py,redhat.py timeout….等错误,添加参数-t 2400调大oz生成镜像的时间!

制作镜像命令:

=========================

oz-install -p -u -d3 -t 2400 -a ks.cfg centos62.tdl

=========================

如果出现虚拟机不能获取ip,删除虚拟机的/etc/udev/rules.d/70-persistent-net.rules文件!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值