Difference between revisions of "Vnx-rootfscentos"
(→Configuration) |
|||
Line 24: | Line 24: | ||
</ul--> | </ul--> | ||
− | <li>Once the installation is finished | + | <li>Once the installation is finished and the installer asks for rebooting the system, just stop the virtual machine using "virsh destroy ..." command and continue with the configuration phase.</li> |
− | |||
− | |||
− | |||
</ul> | </ul> | ||
Line 36: | Line 33: | ||
vnx --modify-rootfs vnx_rootfs_kvm_centos.qcow2 --update-aced --mem 768M | vnx --modify-rootfs vnx_rootfs_kvm_centos.qcow2 --update-aced --mem 768M | ||
Note: ignore the errors "timeout waiting for response on VM socket". 768M are needed if you are installing a root filesystem with desktop interface | Note: ignore the errors "timeout waiting for response on VM socket". 768M are needed if you are installing a root filesystem with desktop interface | ||
− | <li> | + | <li>Configure the serial console:<li> |
+ | <ul> | ||
+ | <li>For CentOS 5.X and 6.X, following these [http://blog.zelut.org/2010/05/05/configure-serial-console-access-on-centos-5/ instructions].</li> | ||
+ | <li>For CentOS 7.X, by executing:</li> | ||
+ | grubby --update-kernel=ALL --args="console=ttyS0" | ||
+ | </ul> | ||
+ | <li>Delete the net udev rules file and reboot the system:</li> | ||
+ | rm /etc/udev/rules.d/70-persistent-net.rules | ||
+ | halt | ||
+ | <li>Once started, access the system through the text console to easy the copy-paste of commands:</li> | ||
virsh console vnx_rootfs_kvm_centos.qcow2 | virsh console vnx_rootfs_kvm_centos.qcow2 | ||
<li>Check that you have network connectivity. Maybe you have to activate the network interface by hand:</li> | <li>Check that you have network connectivity. Maybe you have to activate the network interface by hand:</li> |
Revision as of 23:34, 4 February 2015
How to create a KVM CentOS root filesystem for VNX
Contents
Basic installation
Follow this procedure to create a KVM CentOS based root filesystem for VNX. The procedure has been tested with CentOS 5.6, 6.2, 6.4 and 6.5.
- Create the filesystem disk image:
qemu-img create -f qcow2 vnx_rootfs_kvm_centos.qcow2 12G
wget ftp://ftp.rediris.es/mirror/CentOS/6.5/isos/i386/CentOS-6.5-i386-bin-DVD1.iso cp CentOS-6.5-i386-bin-DVD1.iso /almacen/iso
Note: latests versions of CentOS are distributed in two DVDs. However, only the first DVD is needed for basic installations; no need to download DVD2.
vnx --create-rootfs vnx_rootfs_kvm_centos.qcow2 --install-media /almacen/iso/CentOS-6.5-i386-bin-DVD1.iso --mem 768M
Note: around 768M of memory are needed to use the graphical installation assistant. With the textual assistant the memory requirements are lower (known to work with 512M).
Note: add "--arch x86_64" option for 64 bits virtual machines
Configuration
- Restart the system with the following command:
vnx --modify-rootfs vnx_rootfs_kvm_centos.qcow2 --update-aced --mem 768M
Note: ignore the errors "timeout waiting for response on VM socket". 768M are needed if you are installing a root filesystem with desktop interface
- For CentOS 5.X and 6.X, following these instructions.
- For CentOS 7.X, by executing:
grubby --update-kernel=ALL --args="console=ttyS0"
rm /etc/udev/rules.d/70-persistent-net.rules halt
virsh console vnx_rootfs_kvm_centos.qcow2
dhclient eth1
Note: use "ip link show" to know which network interface to use.
yum install wget wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt rpm -K rpmforge-release-0.5.3-1.el6.rf.*.rpm rpm -i rpmforge-release-0.5.3-1.el6.rf.*.rpm
Note: change 'i686' by 'x86_64' for 64 bits root filesystems.
yum install daemonize
yum update yum install perl perl-XML-LibXML perl-NetAddr-IP acpid
Note: if you get a dependencies error when installing LibXML package, try installing 'perl-XML-SAX' package instead.
mount /dev/sdb /mnt/ perl /mnt/vnxaced-lf/install_vnxaced
- Disable the services you are not going to use to speed up the virtual machine startup (you can see the list of active services with "chkconfig --list"). For example to disable sendmail and bluetooth:
chkconfig sendmail off chkconfig bluetooth off
chkconfig iptables off chkconfig ip6tables off
yum install telnet wget openssh-clients traceroute tcpdump
VER=v0.25 OS=CentOS 6.5 DESC=Basic CentOS 6.5 root-filesystem without GUI
vnx_halt
vnx_halt deletes some caches and log files and optionally lets you write a short message to /etc/vnx_rootfs_version file describing the latest modifications done.
Installing additional software
To install additional software or to modify your root file system, you just have to:
- Start a virtual machine from it:
vnx --modify-rootfs vnx_rootfs_kvm_centos.qcow2
dhclient eth1
Note: use "ip link show" to know which network interface to use.
vnx_halt
Updating VNXACED
You can automatically update the VNXACE daemon with the following command:
vnx --modify-rootfs vnx_rootfs_kvm_centos.qcow2 --update-aced -y
Known issues
- When executing commands using vnx "--exe" option in virtual machines configured with exec_mode="cdrom", traces like the followinf appear on the consoles:
hdb: tray open end_request: I/O error, dev hdb, sector 8388352
They are generated as a result of mount command execution by the VNX daemon. Commands are correctly executed. To be further investigated.