Что мы имеем.:
1. Сервер PowerEdge R910 - Dell
Код: Выделить всё
processor : 79
vendor_id : GenuineIntel
cpu family : 6
model : 47
model name : Intel(R) Xeon(R) CPU E7- 4870 @ 2.40GHz
stepping : 2
microcode : 0x36
cpu MHz : 2394.060
cache size : 30720 KB
physical id : 3
siblings : 20
core id : 25
cpu cores : 10
apicid : 243
initial apicid : 243
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu de tsc msr pae cx8 apic sep cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl nonstop_tsc pni pclmulqdq monitor est ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes hypervisor lahf_lm ida arat dtherm
bogomips : 4788.12
clflush size : 64
cache_alignment : 64
address sizes : 44 bits physical, 48 bits virtual
2. Система gentoo adm64 с ядром 3.5.7-gentoo
3. Установлен xen и xen-tools
Код: Выделить всё
app-emulation/xen-4.1.1-r2 was built with the following:
USE="(multilib) -custom-cflags -debug -flask -pae -xsm"
CFLAGS=""
Код: Выделить всё
app-emulation/xen-tools-4.1.1-r6 was built with the following:
USE="hvm (multilib) qemu screen xend -api -custom-cflags -debug -doc -flask -pygrub"
CFLAGS="-fno-strict-overflow"
CXXFLAGS="-O2 -pipe -fno-strict-overflow"
LDFLAGS=""
xen используется для виртуализации в режиме Paravirtualization. В качестве гостевых ОС тот же самый gentoo.
Конфиг гостевой ОС выглядит так:
Код: Выделить всё
kernel = "/boot/DomU"
vcpus = 2
memory = 4096
name = "test"
vif = [ 'bridge=peth4' ]
disk = [ 'phy:/dev/vlxen/root,xvda,w', 'phy:/dev/vlxen/swap,xvdb,w' ]
root = "/dev/xvda ro"
extra = "console=hvc0 xencons=xvc0"
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'
В таком варианте все супер, все работает, делаешь xm create test.cfg и радуемся)
Дернул меня черт попробовать рулить всем этим добром через virtlib, т.к. есть успешный опыт работы с ним в KVM и как бы поддержка XEN есть.
Поставил себе libvirt
Код: Выделить всё
app-emulation/libvirt-0.10.2-r3 was built with the following:
USE="caps libvirtd lvm lxc macvtap (multilib) nls python udev vepa virt-network xen -audit -avahi -debug -iscsi -nfs -numa -openvz -parted -pcap -phyp -policykit -qemu -rbd -sasl (-selinux) -uml -virtualbox"
Поправил xend-config.sxp на предмет (xend-unix-server yes), сделал /etc/init.d/xend restart и /etc/init.d/libvirtd start. Вроде все норм.
Проверяем
Код: Выделить всё
virsh -c xen:///
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh #
вроде счастье есть.
Теперь решил преобразовать стандартный конфиг виртуалки в xml понятный libvirt
Код: Выделить всё
virsh -c xen:/// domxml-from-native xen-xm test.cfg
<domain type='xen'>
<name>test</name>
<uuid>5e8e64d2-fa11-bf72-b2e1-4e8642fdf8a6</uuid>
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>2</vcpu>
<os>
<type arch='x86_64' machine='xenpv'>linux</type>
<kernel>/boot/DomU</kernel>
<cmdline>console=hvc0 xencons=xvc0</cmdline>
</os>
<clock offset='utc' adjustment='reset'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/vlxen/root'/>
<target dev='xvda' bus='xen'/>
</disk>
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/vlxen/swap'/>
<target dev='xvdb' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:00:00:00:00:00'/>
<source bridge='peth4'/>
</interface>
<console type='pty'>
<target type='xen' port='0'/>
</console>
</devices>
</domain>
Это добро сохраняем в test.xml и пробуем запустить
Код: Выделить всё
virsh -c xen:///
Welcome to virsh, the virtualization interactive terminal.
Type: 'help' for help with commands
'quit' to quit
virsh # create test.xml
Domain test created from test.xml
Вроде все номр, но делаем
Код: Выделить всё
virsh # list
Id Name State
----------------------------------------------------
0 Domain-0 running
И как видим нифига.
Проверяю через xm create родной конфиг - все пучком стартует и работает.
Лезем в логи
Код: Выделить всё
tail -f libvirtd.log
') unexpected exit status 1
2012-11-05 07:49:51.960+0000: 9375: error : ebiptablesDriverTestCLITools:4241 : Testing of ebtables command failed: Failure to execute command '$EBT -t nat -L' : 'FATAL: Module ebtables not found.
The kernel doesn't support the ebtables 'nat' table.'.
2012-11-05 07:50:38.515+0000: 9367: error : xenHypervisorDoV2Sys:1007 : Unable to issue hypervisor ioctl 3166208: Permission denied
2012-11-05 07:50:38.516+0000: 9367: error : xenHypervisorDoV2Sys:1007 : Unable to issue hypervisor ioctl 3166208: Permission denied
2012-11-05 07:50:38.517+0000: 9367: error : xenHypervisorDoV2Sys:1007 : Unable to issue hypervisor ioctl 3166208: Permission denied
2012-11-05 07:50:38.518+0000: 9367: error : xenHypervisorDoV2Sys:1007 : Unable to issue hypervisor ioctl 3166208: Permission denied
2012-11-05 07:50:38.519+0000: 9367: error : xenHypervisorDoV2Sys:1007 : Unable to issue hypervisor ioctl 3166208: Permission denied
2012-11-05 07:54:23.824+0000: 9371: error : virConnectListAllDomains:8250 : this function is not supported by the connection driver: virConnectListAllDomains
Есть только такие сообщения на момент создания домена.
Поиск в лоб в гугле ничего вменяемого не дал.
Вот и вопрос к аудитории: использует ли кто-то в продакшене libvirt для управления гипервизором xen и если да, то сталкивался ли кто-то с такой проблемой).