Difference between revisions of "Vnx-rootfsubuntu"
(12 intermediate revisions by the same user not shown) | |||
Line 33: | Line 33: | ||
</disk> | </disk> | ||
<disk type='file' device='cdrom'> | <disk type='file' device='cdrom'> | ||
− | <source file='/almacen/iso/ubuntu-10.04-server-i386.iso'/> | + | <source file='/almacen/iso/ubuntu-10.04.1-server-i386.iso'/> |
<target dev='hdb'/> | <target dev='hdb'/> | ||
</disk> | </disk> | ||
Line 52: | Line 52: | ||
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml | /usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml | ||
<li>Follow Ubuntu installation menus to install a basic system with ssh server. Once the installation is finished, stop the machine and edit root_fs_ubuntu.xml file and comment the following line in cdrom disk specification:</li> | <li>Follow Ubuntu installation menus to install a basic system with ssh server. Once the installation is finished, stop the machine and edit root_fs_ubuntu.xml file and comment the following line in cdrom disk specification:</li> | ||
+ | <pre> | ||
<!--source file='/almacen/iso/ubuntu-10.04-server-i386.iso'/--> | <!--source file='/almacen/iso/ubuntu-10.04-server-i386.iso'/--> | ||
+ | </pre> | ||
<li>Start the virtual machine again and finish the installation:</li> | <li>Start the virtual machine again and finish the installation:</li> | ||
<ul> | <ul> | ||
Line 60: | Line 62: | ||
apt-get update | apt-get update | ||
apt-get dist-upgrade | apt-get dist-upgrade | ||
− | <li>Install XML::DOM perl package:</li> | + | <li>Install XML::DOM perl package and ACPI daemon:</li> |
− | apt-get install libxml-dom-perl | + | apt-get install libxml-dom-perl acpid |
+ | <li>Only for Ubuntu 10.04:</li> | ||
+ | <ul> | ||
+ | <li>create /media/cdrom* directories:</li> | ||
+ | mkdir /media/cdrom0 | ||
+ | mkdir /media/cdrom1 | ||
+ | ln -s /media/cdrom0 /media/cdrom | ||
+ | ln -s /cdrom /media/cdrom | ||
+ | <li>add the following lines to /etc/fstab:</li> | ||
+ | /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0 | ||
+ | /dev/scd1 /media/cdrom1 udf,iso9660 user,noauto,exec,utf8 0 0 | ||
+ | </ul> | ||
+ | <li>Configure a serial console on ttyS0:</li> | ||
+ | cd /etc/init | ||
+ | cp tty1.conf ttyS0.conf | ||
+ | sed -i -e 's/tty1/ttyS0/' ttyS0.conf | ||
+ | <li>Activate startup traces on serial console by editting /boot/grub/grub.cfg file and adding "console=ttyS0" to the linux line. For example:</li> | ||
+ | linux /boot/vmlinuz-2.6.35-25-generic-pae root=UUID=eb1a0afb-48b2-4e42-ba6d-22bfae1055f3 ro quiet console=ttyS0 | ||
<li>Install VNX autoconfiguration daemon:</li> | <li>Install VNX autoconfiguration daemon:</li> | ||
<ul> | <ul> | ||
Line 73: | Line 92: | ||
rm /etc/udev/rules.d/70-persistent-net.rules | rm /etc/udev/rules.d/70-persistent-net.rules | ||
rm /etc/udev/rules.d/70-persistent-cd.rules | rm /etc/udev/rules.d/70-persistent-cd.rules | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<li>Optional: install graphical user interface.</li> | <li>Optional: install graphical user interface.</li> | ||
<ul> | <ul> | ||
Line 91: | Line 99: | ||
sudo apt-get install ubuntu-desktop | sudo apt-get install ubuntu-desktop | ||
</ul> | </ul> | ||
− | <li>Optional: install other services | + | <li>Optional: install other services:</li> |
+ | <ul> | ||
+ | <li>Apache server:</li> | ||
sudo apt-get install apache2 | sudo apt-get install apache2 | ||
update-rc.d -f apache2 remove # to avoid automatic start | update-rc.d -f apache2 remove # to avoid automatic start | ||
− | <li> | + | <li>Other network tools</li> |
+ | sudo apt-get install traceroute | ||
+ | </ul> | ||
+ | <li>Clean cache and stop the machine with:</li> | ||
+ | apt-get clean | ||
halt | halt | ||
</ul> | </ul> | ||
</ul> | </ul> | ||
+ | |||
+ | If everything went well, your root filesystem will be ready to be used with VNX. You can make a simple test using the simple_ubuntu.xml scenario distributed with VNX. | ||
=== Installing additional software === | === Installing additional software === | ||
To install additional software or modify your root file system, you just have to start it as described above and make the operations required on the filesystem. | To install additional software or modify your root file system, you just have to start it as described above and make the operations required on the filesystem. | ||
+ | * Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility): | ||
+ | /usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml | ||
+ | * Install the software: | ||
+ | apt-get install ... | ||
+ | * Delete udev rules files: | ||
+ | rm /etc/udev/rules.d/70-persistent-net.rules | ||
+ | rm /etc/udev/rules.d/70-persistent-cd.rules | ||
+ | * Stop the machine with: | ||
+ | halt | ||
=== Updating ACE daemon === | === Updating ACE daemon === |
Latest revision as of 21:50, 30 March 2011
How to create a Ubuntu root-file-system for VNX
Follow this procedure to create a Ubuntu based root-file-system for VNX. The procedure has been tested with Ubuntu 9.10 and 10.04.
- Create the filesystem disk image:
qemu-img create -f qcow2 root_fs_ubuntu-base.qcow2 5GB
wget ftp://ftp.rediris.es/mirror/ubuntu-releases/10.04.1/ubuntu-10.04.1-server-i386.iso cp ubuntu-10.04.1-server-i386.iso /almacen/iso
<domain type='kvm'> <name>Ubuntu</name> <memory>524288</memory> <vcpu>1</vcpu> <os> <type arch="i686">hvm</type> <boot dev='hd'/> <boot dev='cdrom'/> </os> <features> <pae/> <acpi/> <apic/> </features> <clock sync="localtime"/> <devices> <emulator>/usr/bin/kvm</emulator> <disk type='file' device='disk'> <source file='/usr/share/vnx/filesystems/root_fs_ubuntu-base.qcow2'/> <target dev='hda'/> <driver name="qemu" type="qcow2"/> </disk> <disk type='file' device='cdrom'> <source file='/almacen/iso/ubuntu-10.04.1-server-i386.iso'/> <target dev='hdb'/> </disk> <interface type='network'> <source network='default'/> </interface> <graphics type='vnc'/> </devices> </domain>
Note: change "source file=" lines to whatever fits your case (use full paths).
virsh create root_fs_ubuntu.xml
virt-viewer Ubuntu
Note: alternative you can start the machine and open the console at the same time with the command:
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml
<!--source file='/almacen/iso/ubuntu-10.04-server-i386.iso'/-->
- Access the console and sudo root:
sudo su
apt-get update apt-get dist-upgrade
apt-get install libxml-dom-perl acpid
- create /media/cdrom* directories:
mkdir /media/cdrom0 mkdir /media/cdrom1 ln -s /media/cdrom0 /media/cdrom ln -s /cdrom /media/cdrom
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0 /dev/scd1 /media/cdrom1 udf,iso9660 user,noauto,exec,utf8 0 0
cd /etc/init cp tty1.conf ttyS0.conf sed -i -e 's/tty1/ttyS0/' ttyS0.conf
linux /boot/vmlinuz-2.6.35-25-generic-pae root=UUID=eb1a0afb-48b2-4e42-ba6d-22bfae1055f3 ro quiet console=ttyS0
- From the host execute:
/usr/share/vnx/bin/vnx_update_aced Ubuntu /usr/share/vnx/aced/vnx-aced-lf-0.1b.tgz
mount /media/cdrom /media/cdrom/install_vnxdaemon
rm /etc/udev/rules.d/70-persistent-net.rules rm /etc/udev/rules.d/70-persistent-cd.rules
- Minimal:
sudo apt-get install xorg gnome-core gksu gdm gnome-system-tools gnome-nettool firefox-gnome-support
sudo apt-get install ubuntu-desktop
- Apache server:
sudo apt-get install apache2 update-rc.d -f apache2 remove # to avoid automatic start
sudo apt-get install traceroute
apt-get clean halt
If everything went well, your root filesystem will be ready to be used with VNX. You can make a simple test using the simple_ubuntu.xml scenario distributed with VNX.
Installing additional software
To install additional software or modify your root file system, you just have to start it as described above and make the operations required on the filesystem.
- Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility):
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml
- Install the software:
apt-get install ...
- Delete udev rules files:
rm /etc/udev/rules.d/70-persistent-net.rules rm /etc/udev/rules.d/70-persistent-cd.rules
- Stop the machine with:
halt
Updating ACE daemon
If you have a root filesystem with the autoconfiguration and command execution daemon (ACE) already installed, you can use the autoupdate functionallity to update the daemon to a newer version. Just follow this procedure:
- Edit the xml described above and comment the line defining the Ubuntu iso file for the cdrom:
- Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility):
/usr/share/vnx/bin/vnx_modify_rootfs root_fs_ubuntu.xml
- Execute the update utility:
/usr/share/vnx/bin/vnx_update_aced Ubuntu /usr/share/vnx/aced/vnx-aced-lf-0.1b.tgz
- Once the ace daemon is updated the virtual machine will be rebooted automatically.
Known problems
- Each a cdrom is mounted (for example, ehenever a command is executed on the virtual machine) the following error appear in the console:
Jul 27 22:33:31 vnx kernel: [ 4384.875886] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 Jul 27 22:33:31 vnx kernel: [ 4385.291374] ata1.01: BMDMA stat 0x5 Jul 27 22:33:31 vnx kernel: [ 4385.493411] sr 0:0:1:0: [sr0] CDB: Read(10): 28 00 00 00 00 18 00 00 01 00 Jul 27 22:33:31 vnx kernel: [ 4385.493460] ata1.01: cmd a0/01:00:00:00:08/00:00:00:00:00/b0 tag 0 dma 2048 in Jul 27 22:33:31 vnx kernel: [ 4385.493461] res 01/60:00:00:00:08/00:00:00:00:00/b0 Emask 0x3 (HSM violation) Jul 27 22:33:31 vnx kernel: [ 4386.263553] ata1.01: status: { ERR }
However, the command are executed correctly. This error does not appear on Ubuntu 9.10 filesystems.