« Freenas with Xen » : différence entre les versions

De TeriaHowto
Sauter à la navigation Sauter à la recherche
Ligne 11 : Ligne 11 :


* Xml configuration for Libvirt :
* Xml configuration for Libvirt :
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
  <domain type='xen'>
<domain type='xen'>
    <name>freebsd</name>
  <name>freebsd</name>
    <memory unit='KiB'>2097152</memory>
  <memory unit='KiB'>2097152</memory>
    <currentMemory unit='KiB'>2097152</currentMemory>
  <currentMemory unit='KiB'>2097152</currentMemory>
    <vcpu placement='static'>1</vcpu>
  <vcpu placement='static'>1</vcpu>
    <os>
  <os>
      <type arch='x86_64' machine='xenfv'>hvm</type>
    <type arch='x86_64' machine='xenfv'>hvm</type>
      <loader type='rom'>/usr/lib/xen/boot/hvmloader</loader>
    <loader type='rom'>/usr/lib/xen/boot/hvmloader</loader>
      <boot dev='cdrom'/>
    <boot dev='cdrom'/>
      <boot dev='hd'/>
    <boot dev='hd'/>
    </os>
  </os>
    <features>
  <features>
      <acpi/>
    <acpi/>
      <apic/>
    <apic/>
      <pae/>
    <pae/>
      <hap/>
    <hap/>
    </features>
  </features>
    <clock offset='variable' adjustment='0' basis='utc'>
  <clock offset='variable' adjustment='0' basis='utc'>
      <timer name='hpet' present='no'/>
    <timer name='hpet' present='no'/>
    </clock>
  </clock>
    <on_poweroff>destroy</on_poweroff>
  <on_poweroff>destroy</on_poweroff>
    <on_reboot>restart</on_reboot>
  <on_reboot>restart</on_reboot>
    <on_crash>restart</on_crash>
  <on_crash>restart</on_crash>
    <devices>
  <devices>
      <emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
    <emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
      <disk type='block' device='disk'>
    <disk type='block' device='disk'>
        <driver name='phy'/>
      <driver name='phy'/>
        <source dev='/dev/system/freebsd.reseau.ld-disk'/>
      <source dev='/dev/system/freebsd.reseau.ld-disk'/>
        <target dev='xvda' bus='xen'/>
      <target dev='xvda' bus='xen'/>
      </disk>
    </disk>
      <disk type='file' device='cdrom'>
    <disk type='file' device='cdrom'>
        <source file='/opt/ISO/FreeBSD-9.3-RELEASE-amd64-bootonly.iso'/>
      <source file='/opt/ISO/FreeBSD-9.3-RELEASE-amd64-bootonly.iso'/>
        <target dev='hdc' bus='ide'/>
      <target dev='hdc' bus='ide'/>
        <readonly/>
      <readonly/>
        <address type='drive' controller='0' bus='1' target='0' unit='0'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
      </disk>
    </disk>
      <controller type='ide' index='0'/>
    <controller type='ide' index='0'/>
      <interface type='bridge'>
    <interface type='bridge'>
        <mac address='00:16:3e:xx:xx:xx'/>
      <mac address='00:16:3e:xx:xx:xx'/>
        <source bridge='xenbr0'/>
      <source bridge='xenbr0'/>
        <script path='/etc/xen/scripts/vif-openvswitch'/>
      <script path='/etc/xen/scripts/vif-openvswitch'/>
        <model type='e1000'/>
      <model type='e1000'/>
      </interface>
    </interface>
      <serial type='pty'>
    <serial type='pty'>
        <target port='0'/>
      <target port='0'/>
      </serial>
    </serial>
      <console type='pty'>
    <console type='pty'>
        <target type='serial' port='0'/>
      <target type='serial' port='0'/>
      </console>
    </console>
      <input type='mouse' bus='ps2'/>
    <input type='mouse' bus='ps2'/>
      <input type='keyboard' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
      <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='fr'>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='fr'>
        <listen type='address' address='0.0.0.0'/>
      <listen type='address' address='0.0.0.0'/>
      </graphics>
    </graphics>
      <video>
    <video>
        <model type='cirrus' vram='16384' heads='1'/>
      <model type='cirrus' vram='16384' heads='1'/>
      </video>
    </video>
    </devices>
  </devices>
  </domain>
</domain>
</syntax>
</syntaxhighlight>


test
test

Version du 5 juin 2015 à 13:26

This howto is based on the excellent work made by My Wired House. It aims at building FreeNAS with PVHVM support.
It aims at building Freenas 9.3 with PHVMH support and ultimately at putting it into production with PCI passthrough.

Build environment

  • Install a Freebsd 9.3 (in a domU for example)
  • Make a few adjustements
  • Build Freenas

Freebsd 9.3 in a domU

  • Xml configuration for Libvirt :
<domain type='xen'>
  <name>freebsd</name>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='xenfv'>hvm</type>
    <loader type='rom'>/usr/lib/xen/boot/hvmloader</loader>
    <boot dev='cdrom'/>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
    <hap/>
  </features>
  <clock offset='variable' adjustment='0' basis='utc'>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
    <disk type='block' device='disk'>
      <driver name='phy'/>
      <source dev='/dev/system/freebsd.reseau.ld-disk'/>
      <target dev='xvda' bus='xen'/>
    </disk>
    <disk type='file' device='cdrom'>
      <source file='/opt/ISO/FreeBSD-9.3-RELEASE-amd64-bootonly.iso'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <controller type='ide' index='0'/>
    <interface type='bridge'>
      <mac address='00:16:3e:xx:xx:xx'/>
      <source bridge='xenbr0'/>
      <script path='/etc/xen/scripts/vif-openvswitch'/>
      <model type='e1000'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='fr'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='16384' heads='1'/>
    </video>
  </devices>
</domain>

test