Overblog Suivre ce blog
Editer l'article Administration Créer mon blog
26 avril 2012 4 26 /04 /avril /2012 08:24

I've installed an openfiler on the KVM with directe access to disk.


I use a file to hold the Virtaul machine and I give it a directe acess to disk /dev/hda and /dev/hdb


1 - Generate the VM


cat <EOF>>/srv/VM/openfiler29.sh


virt-install \
-n${NAME} \
--description 'OpenFiler 2.99' \
--ram 512 \
--vcpus=1 \
--autostart \
--os-type linux \
--hvm \
--accelerate \
-v \
--network bridge=br0,model=virtio \
--disk path=/srv/VM/OS/lv_${NAME}_os.qcow2,size=${DISK} \
-c ${ISO} \
--vnc --vnclisten= --vncport=5901\
-k fr-fr


we finish by connecting to the VM with vnc on port 5901.
I suggest to add an ssh authentification to do the rest of the configuration remotely (lots of documentation about this on the web)

2 - update the openfiler

Here are some command to do have the last version

conary update conary
conary updateall
conary update openfiler

add some package
conary install patch testdisk


3 - correction and modification


RAID-1(from : http://www.everything-virtual.com/?p=349)

conary update mdadm=openfiler.rpath.org@rpl:devel/2.6.4-0.2-1
ln -s /sbin/lvm /usr/sbin/lvm


Virtual drive in openfiler those show by the use of virtio. We need to had some line in /opt/openfiler/sbin/list-disks.pl

I've done a small patch. you can apply this way :


cd /opt/openfiler/sbin/

conary install patch
patch -bR -p1 /opt/openfiler/sbin/list-disks.pl< ./list-disks.pl.patch
chown openfiler.openfiler /opt/openfiler/sbin/list-disks.pl
chmod 755 /opt/openfiler/sbin/list-disks.pl


cat list-disks.pl.patch


--- list-disks.pl    2012-04-22 14:24:14.000000000 +0200
+++ /opt/openfiler/sbin/list-disks.pl    2009-05-16 19:07:57.000000000 +0200
@@ -188,11 +188,6 @@
             # Promise raid controller
             push(@devs, "/dev/$1");
-        elsif (/\d+\s+\d+\s+\d+\s+vd(\S)\s/ || /\d+\s+\d+\s+\d+\s+vd(\S\D)\s/) {
-             # virtio raid device
-             local $d = $1;
-             push(@devs, "/dev/vd$d");
-         }
@@ -329,11 +324,7 @@
                 $disk->{'desc'} = &text('select_device', 'IDE', uc($1));
                 $disk->{'type'} = 'ide';
-            elsif ($disk->{'device'} =~ /\/vd(\S)$/) {
-                # VIRTIO disk
-                $disk->{'desc'} = &text('select_device', 'IDE', uc($1));
-                $disk->{'type'} = 'ide';
-            }   
             elsif ($disk->{'device'} =~ /\/xvd(\S)$/) {
                 # Xen disk
                 $disk->{'desc'} = &text('select_device', 'IDE', uc($1));


3 -


change the Virtual MAchine definition to allow access to disk directly


virsh dumpxml openfiler29 >openfiler29.xml


root@HostVm:/srv/VM# cat openfiler29.xml
<domain type='kvm' id='15'>
  <description>OpenFiler 2.99</description>
    <type arch='x86_64' machine='pc-1.0'>hvm</type>
    <boot dev='hd'/>
  <clock offset='utc'/>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/srv/VM/OS/lv_openfiler29_os.qcow2'/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hdd' bus='ide'/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' unit='0'/>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/dev/sda'/>
      <target dev='hdb' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/dev/sdb'/>
      <target dev='hdc' bus='virtio'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    <interface type='bridge'>
      <mac address='52:54:00:95:ec:fc'/>
      <source bridge='br0'/>
      <target dev='vnet1'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    <serial type='pty'>
      <source path='/dev/pts/4'/>
      <target port='0'/>
      <alias name='serial0'/>
    <console type='pty' tty='/dev/pts/4'>
      <source path='/dev/pts/4'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5901' autoport='no' listen='' keymap='fr'>
      <listen type='address' address=''/>
      <model type='cirrus' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
  <seclabel type='dynamic' model='apparmor' relabel='yes'>


update openfiler29 VM


virsh dumpxml openfiler29 >openfiler29.xml

virsh shutdown openfiler29

virsh define openfiler29.xml

virsh start openfiler29



4 - active directory Integration

Copy and past from an other web site http://www.ozziks.com/2008/12/13/join-openfiler-to-active-directory/

Partager cet article

Repost 0
Published by nitocris - dans Linux
commenter cet article