openstack-CentOS镜像制作
CentOS6.5下制作CentOS镜像文件在控制节点或者带有桌面环境的机器中安装以下命令:1. 安装基础环境yum -ygroupinstall Virtualization*service libvirtdstart2. 在桌面环境中启动virt-manage应用或者在命令行中输入: virt–manager,进入如下页面file:///C:\Users\ADMINI~1\AppData\Local\Temp\msohtmlclip1\01\clip_image002.jpg3. 创建虚拟机file:///C:\Users\ADMINI~1\AppData\Local\Temp\msohtmlclip1\01\clip_image003.png点击创建虚拟机按钮打开创建虚拟机对话框,如下图所示:file:///C:\Users\ADMINI~1\AppData\Local\Temp\msohtmlclip1\01\clip_image004.pngfile:///C:\Users\ADMINI~1\AppData\Local\Temp\msohtmlclip1\01\clip_image005.png 整个虚拟机的创建过程跟在其他虚拟机软件中的创建过程基本一致,需要注意的是:1.网络选择,选择:NAT;2.硬盘存储的选择时选择IMG格式的硬盘(qcow2格式)。3.磁盘位置:/var/lib/libvirt/images/*4.网络设置时,设置网络为自动获取IP,也就是HDCP的方式,网路设置为自动连接。5.root用户的密码为:rootpass6.分区时只设置一个“/”分区7.服务器选择选择:basicServer8.安装完成后重启。
file:///C:\Users\ADMINI~1\AppData\Local\Temp\msohtmlclip1\01\clip_image007.png
file:///C:\Users\ADMINI~1\AppData\Local\Temp\msohtmlclip1\01\clip_image008.png4. 相关配置1.修改启动文件Vi /boot/grub/grub.conf中加入selinux=0enforcing=02.为了使控制台起作用:Vi /boot/grub/menu.lstserial --unit=0 --speed=115200terminal --timeout=10 console serial# Edit the kernel line to add the console entrieskernel ... console=tty0console=ttyS0,115200n83.Vi /etc/ssh/ssd_config 修改UseDNS=no, GSSAPIAuthentication no4.修改/etc/ssh/sshd_config的PasswordAuthentication项为yes//否则远程ssh报错。5.进入虚拟机后,安装colud-init包rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum installcloud-init cloud-utils parted git cd /tmpgit clonehttps://github.com/flegmatik/linux-rootfs-resize.gitcdlinux-rootfs-resize./install6.Edit /etc/cloud/cloud.cfg and under cloud_init_modules add:- resolv-conf 可以去掉:- ssh 7.设置网卡,去掉MAC地址Vi/etc/sysconfig/network-scripts/ifcfg-eth08.去掉路由文件(非常重要)rm -rf/etc/udev/rules.d/70-persistent-net.rules9.关闭防火墙sed -is/^SELINUX=.*/SELINUX=disabled/g /etc/selinux/configservice iptablesstop && chkconfig iptables offservice ip6tablesstop && chkconfig ip6tables off10. 在网路设置的配置文件/etc/sysconfig/network中加入配置:NOZEROCONF=yes11. 一定通过shutdown –h now来关机图文详情请查看附件。
页:
[1]