[GH-ISSUE #235] Edit default XML files #154

Open
opened 2026-02-27 15:57:33 +03:00 by kerem · 9 comments
Owner

Originally created by @4920441 on GitHub (Apr 18, 2019).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/235

Hi,
I have to workaround this bug:
https://bugs.archlinux.org/task/60566
with my Opteron 6276...

Do I have to directly edit this file to accomplish that?

create/templates/create_instance.html

For testing purposes, I changed it directly in a generated instances xml file and after that it works fine, but I'd like to have it as default as well.

Thanks a lot!

Originally created by @4920441 on GitHub (Apr 18, 2019). Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/235 Hi, I have to workaround this bug: https://bugs.archlinux.org/task/60566 with my Opteron 6276... Do I have to directly edit this file to accomplish that? create/templates/create_instance.html For testing purposes, I changed it directly in a generated instances xml file and after that it works fine, but I'd like to have it as default as well. Thanks a lot!
Author
Owner

@catborise commented on GitHub (Apr 19, 2019):

hi,
in the vrtManager/create.py file, you could change the function;

def create_instance(self, name, memory, vcpu, host_model, uuid, images, cache_mode, networks, virtio, listen_addr, nwfilter=None,.....
line:
if host_model: xml += """<cpu mode='host-model'/>""" ->>>>>> you change as you want the generated xml.

<!-- gh-comment-id:484775314 --> @catborise commented on GitHub (Apr 19, 2019): hi, in the vrtManager/create.py file, you could change the function; ` def create_instance(self, name, memory, vcpu, host_model, uuid, images, cache_mode, networks, virtio, listen_addr, nwfilter=None,..... ` line: ` if host_model: xml += """<cpu mode='host-model'/>""" ->>>>>> you change as you want the generated xml. `
Author
Owner

@4920441 commented on GitHub (Apr 19, 2019):

Hmm... works partially...:

Despite I put in create.py:
xml += """<cpu mode='custom' match='exact' check='partial'/><model fallback='allow'>Opteron_G4</model>""" xml += """<os> <type arch='%s'>%s</type> <boot dev='hd'/> <boot dev='cdrom'/> <bootmenu enable='yes'/>
I get in the generated .XML:
</features> <cpu mode='custom' match='exact'> <model fallback='forbid'>Opteron_G4</model> <vendor>AMD</vendor>

Seems check='partial' and model fallback='allow' are defined somewhere else as well?

Cheers,

P.S.:

The Instance where I manually edited the xml file to test the workaround is working also was reset to the defaults....

<cpu mode='custom' match='exact'> <model fallback='forbid'>Opteron_G4</model> </cpu>
:-(

<!-- gh-comment-id:484827114 --> @4920441 commented on GitHub (Apr 19, 2019): Hmm... works partially...: Despite I put in create.py: ` xml += """<cpu mode='custom' match='exact' check='partial'/><model fallback='allow'>Opteron_G4</model>""" xml += """<os> <type arch='%s'>%s</type> <boot dev='hd'/> <boot dev='cdrom'/> <bootmenu enable='yes'/> ` I get in the generated .XML: ` </features> <cpu mode='custom' match='exact'> <model fallback='forbid'>Opteron_G4</model> <vendor>AMD</vendor> ` Seems check='partial' and model fallback='allow' are defined somewhere else as well? Cheers, P.S.: The Instance where I manually edited the xml file to test the workaround is working also was reset to the defaults.... `<cpu mode='custom' match='exact'> <model fallback='forbid'>Opteron_G4</model> </cpu> ` :-(
Author
Owner

@catborise commented on GitHub (Apr 19, 2019):

no it is not defined in webvirtcloud. Libvirt fills its defaults if there is some xml glitch.

i think you change it not right way. you should check this
https://libvirt.org/formatdomain.html#elementsCPU

you must not close cpu tag before its properties set
<cpu mode='custom' match='exact'><model fallback='allow'>Opteron_G4</model></cpu>

<!-- gh-comment-id:484860884 --> @catborise commented on GitHub (Apr 19, 2019): no it is not defined in webvirtcloud. Libvirt fills its defaults if there is some xml glitch. i think you change it not right way. you should check this https://libvirt.org/formatdomain.html#elementsCPU you must not close cpu tag before its properties set ` <cpu mode='custom' match='exact'><model fallback='allow'>Opteron_G4</model></cpu> `
Author
Owner

@4920441 commented on GitHub (Apr 20, 2019):

Hmm... one (or two) caveat(s), whatsoever...:

If I use WebVirtCloud via ssh connections to manage several servers I HAVE to create the instance on the opteron 6276 server first, because, anywhere else created, it won't boot there...

The next thing which would be problematic (did not test yet because of lacking shared storage in my test setup) I think is migrating the vm from the Opteron 6276 Server to a Xeon E3/E5 Server and vice versa... if the Flags are ignored migrating from AMD to Intel should work, but not the other way round.

Still, could be worse:-) I am more happy with WebVirtCloud than with ESXi 6.5/6.7 so far:-)))

<!-- gh-comment-id:485159094 --> @4920441 commented on GitHub (Apr 20, 2019): Hmm... one (or two) caveat(s), whatsoever...: If I use WebVirtCloud via ssh connections to manage several servers I HAVE to create the instance on the opteron 6276 server first, because, anywhere else created, it won't boot there... The next thing which would be problematic (did not test yet because of lacking shared storage in my test setup) I think is migrating the vm from the Opteron 6276 Server to a Xeon E3/E5 Server and vice versa... if the Flags are ignored migrating from AMD to Intel should work, but not the other way round. Still, could be worse:-) I am more happy with WebVirtCloud than with ESXi 6.5/6.7 so far:-)))
Author
Owner

@catborise commented on GitHub (Apr 20, 2019):

I have also opteron cpus. I have not get any problem so far. I did not understand the root cause. What is host os. Libvirt version? Qemu version?

Migration from different architectures always problematic even on esxi. I also do not test it but i do not have hope for that :)
I could install a test system with opteron cpus.

<!-- gh-comment-id:485165462 --> @catborise commented on GitHub (Apr 20, 2019): I have also opteron cpus. I have not get any problem so far. I did not understand the root cause. What is host os. Libvirt version? Qemu version? Migration from different architectures always problematic even on esxi. I also do not test it but i do not have hope for that :) I could install a test system with opteron cpus.
Author
Owner

@4920441 commented on GitHub (Apr 22, 2019):

Hi catborise,

The host OS Ist debian Linux 9 with the official qemu + libvirt debs from the repository:

qemu-x86_64 -version
qemu-x86_64 version 2.8.1(Debian 1:2.8+dfsg-6+deb9u5)
Copyright (c) 2003-2016 Fabrice Bellard and the QEMU Project developers

libvirtd -V
libvirtd (libvirt) 3.0.0

I don't know what the root cause ist... until a couple of days ago, there was virtualbox installed on the system, but it is gone, so are the kernel modules and all other stuff... so that should not be the problem.

Using the Kernel from the Backports Reps...:

Linux nux 4.19.0-0.bpo.4-amd64 #1 SMP Debian 4.19.28-2~bpo9+1 (2019-03-27) x86_64 GNU/Linux

The mainboard is a Supermicro H8SGL with 'latest' Bios (which is already 2016 or so I think...)

Processor is a 2nd generation G34 Opteron 6276

As mentioned, before migrating that machine, I testet it on several i3-3220, Intel Xeon E3-12xx and a rather old Xeon L3426 and never got any glitches with qemu...

`
processor : 15
vendor_id : AuthenticAMD
cpu family : 21
model : 1
model name : AMD Opteron(TM) Processor 6276
stepping : 2
microcode : 0x600063d
cpu MHz : 1754.900
cache size : 2048 KB
physical id : 0
siblings : 16
core id : 7
cpu cores : 8
apicid : 47
initial apicid : 15
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid amd_dcm aperfmperf pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 nodeid_msr topoext perfctr_core perfctr_nb cpb hw_pstate ssbd vmmcall arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold
bugs : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass
bogomips : 4599.93
TLB size : 1536 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb

<!-- gh-comment-id:485422684 --> @4920441 commented on GitHub (Apr 22, 2019): Hi catborise, The host OS Ist debian Linux 9 with the official qemu + libvirt debs from the repository: qemu-x86_64 -version qemu-x86_64 version 2.8.1(Debian 1:2.8+dfsg-6+deb9u5) Copyright (c) 2003-2016 Fabrice Bellard and the QEMU Project developers libvirtd -V libvirtd (libvirt) 3.0.0 I don't know what the root cause ist... until a couple of days ago, there was virtualbox installed on the system, but it is gone, so are the kernel modules and all other stuff... so that should not be the problem. Using the Kernel from the Backports Reps...: Linux nux 4.19.0-0.bpo.4-amd64 #1 SMP Debian 4.19.28-2~bpo9+1 (2019-03-27) x86_64 GNU/Linux The mainboard is a Supermicro H8SGL with 'latest' Bios (which is already 2016 or so I think...) Processor is a 2nd generation G34 Opteron 6276 As mentioned, before migrating that machine, I testet it on several i3-3220, Intel Xeon E3-12xx and a rather old Xeon L3426 and never got any glitches with qemu... ` processor : 15 vendor_id : AuthenticAMD cpu family : 21 model : 1 model name : AMD Opteron(TM) Processor 6276 stepping : 2 microcode : 0x600063d cpu MHz : 1754.900 cache size : 2048 KB physical id : 0 siblings : 16 core id : 7 cpu cores : 8 apicid : 47 initial apicid : 15 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid amd_dcm aperfmperf pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 nodeid_msr topoext perfctr_core perfctr_nb cpb hw_pstate ssbd vmmcall arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bugs : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass bogomips : 4599.93 TLB size : 1536 4K pages clflush size : 64 cache_alignment : 64 address sizes : 48 bits physical, 48 bits virtual power management: ts ttp tm 100mhzsteps hwpstate cpb ```
Author
Owner

@catborise commented on GitHub (Apr 24, 2019):

i prepare new environment, host OS: centos 7.6 :

virsh version
Compiled against library: libvirt 4.5.0
Using library: libvirt 4.5.0
Using API: QEMU 4.5.0
Running hypervisor: QEMU 1.5.3

hypervisor host ---> lscpu

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
CPU(s):                48
On-line CPU(s) list:   0-47
Thread(s) per core:    1
Core(s) per socket:    12
Socket(s):             4
NUMA node(s):          8
Vendor ID:             AuthenticAMD
CPU family:            16
Model name:            AMD Opteron(tm) Processor 6174
first test:
  • add it with tcp connection.
  • create an instance with webvirtcloud using "custom" option, checked "host-model"
  • Start it.
  • It successfully started.
  • Generated xml:
 <cpu mode='custom' match='exact' check='full'>
    <model fallback='forbid'>Opteron_G3</model>
    <vendor>AMD</vendor>
    <feature policy='require' name='vme'/>
    <feature policy='disable' name='ht'/>
    <feature policy='require' name='mmxext'/>
    <feature policy='require' name='fxsr_opt'/>
    <feature policy='require' name='pdpe1gb'/>
    <feature policy='require' name='3dnowext'/>
    <feature policy='require' name='3dnow'/>
    <feature policy='require' name='cmp_legacy'/>
    <feature policy='disable' name='extapic'/>
    <feature policy='require' name='cr8legacy'/>
    <feature policy='require' name='3dnowprefetch'/>
    <feature policy='require' name='osvw'/>
    <feature policy='disable' name='ibs'/>
    <feature policy='disable' name='skinit'/>
    <feature policy='disable' name='wdt'/>
    <feature policy='disable' name='nodeid_msr'/>
    <feature policy='disable' name='monitor'/>
    <feature policy='require' name='x2apic'/>
    <feature policy='require' name='hypervisor'/>
    <feature policy='disable' name='rdtscp'/>
  </cpu>

second test:

  • create an instance with webvirtcloud using "custom" option, non-checked "host-model"
  • Start it.
  • It successfully started.
  • Generated XML:
 <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>

i will try that test with host OS debian also.

<!-- gh-comment-id:486204553 --> @catborise commented on GitHub (Apr 24, 2019): i prepare new environment, host OS: centos 7.6 : ``` virsh version Compiled against library: libvirt 4.5.0 Using library: libvirt 4.5.0 Using API: QEMU 4.5.0 Running hypervisor: QEMU 1.5.3 ``` hypervisor host ---> lscpu ``` Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit CPU(s): 48 On-line CPU(s) list: 0-47 Thread(s) per core: 1 Core(s) per socket: 12 Socket(s): 4 NUMA node(s): 8 Vendor ID: AuthenticAMD CPU family: 16 Model name: AMD Opteron(tm) Processor 6174 first test: ``` - add it with tcp connection. - create an instance with webvirtcloud using "custom" option, checked "host-model" - Start it. - It successfully started. - Generated xml: ```xml <cpu mode='custom' match='exact' check='full'> <model fallback='forbid'>Opteron_G3</model> <vendor>AMD</vendor> <feature policy='require' name='vme'/> <feature policy='disable' name='ht'/> <feature policy='require' name='mmxext'/> <feature policy='require' name='fxsr_opt'/> <feature policy='require' name='pdpe1gb'/> <feature policy='require' name='3dnowext'/> <feature policy='require' name='3dnow'/> <feature policy='require' name='cmp_legacy'/> <feature policy='disable' name='extapic'/> <feature policy='require' name='cr8legacy'/> <feature policy='require' name='3dnowprefetch'/> <feature policy='require' name='osvw'/> <feature policy='disable' name='ibs'/> <feature policy='disable' name='skinit'/> <feature policy='disable' name='wdt'/> <feature policy='disable' name='nodeid_msr'/> <feature policy='disable' name='monitor'/> <feature policy='require' name='x2apic'/> <feature policy='require' name='hypervisor'/> <feature policy='disable' name='rdtscp'/> </cpu> ``` second test: - create an instance with webvirtcloud using "custom" option, non-checked "host-model" - Start it. - It successfully started. - Generated XML: ```xml <features> <acpi/> <apic/> <pae/> </features> ``` i will try that test with host OS debian also.
Author
Owner

@catborise commented on GitHub (Apr 25, 2019):

i prepare new environment, host OS: Debian 9.8 :

cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
 virsh version
Compiled against library: libvirt 3.0.0
Using library: libvirt 3.0.0
Using API: QEMU 3.0.0
Running hypervisor: QEMU 2.8.1
 lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                48
On-line CPU(s) list:   0-47
Thread(s) per core:    1
Core(s) per socket:    12
Socket(s):             4
NUMA node(s):          8
Vendor ID:             AuthenticAMD
CPU family:            16
Model:                 9
Model name:            AMD Opteron(tm) Processor 6174
  • create an instance with webvirtcloud using "custom" option, checked "host-model"
  • Start it.
  • It successfully started.
  • Generated XML:
<features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='forbid'>Opteron_G3</model>
    <vendor>AMD</vendor>
    <feature policy='require' name='vme'/>
    <feature policy='require' name='ht'/>
    <feature policy='require' name='mmxext'/>
    <feature policy='require' name='fxsr_opt'/>
    <feature policy='require' name='pdpe1gb'/>
    <feature policy='require' name='3dnowext'/>
    <feature policy='require' name='3dnow'/>
    <feature policy='require' name='cmp_legacy'/>
    <feature policy='require' name='extapic'/>
    <feature policy='require' name='cr8legacy'/>
    <feature policy='require' name='3dnowprefetch'/>
    <feature policy='require' name='osvw'/>
    <feature policy='require' name='ibs'/>
    <feature policy='require' name='skinit'/>
    <feature policy='require' name='wdt'/>
    <feature policy='require' name='nodeid_msr'/>
  </cpu>
  • create an instance with webvirtcloud using "custom" option, non-checked "host-model"
  • Start it.
  • It successfully started.
  • Generated XML:
<features>
    <acpi/>
    <apic/>
    <pae/>
  </features>

i cannot reproduce your problem. I do not know what is the difference.
i think the bug you specified is special to you.
sorry

have a nice day

<!-- gh-comment-id:486547724 --> @catborise commented on GitHub (Apr 25, 2019): i prepare new environment, host OS: Debian 9.8 : ``` cat /etc/*-release PRETTY_NAME="Debian GNU/Linux 9 (stretch)" NAME="Debian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" ``` ``` virsh version Compiled against library: libvirt 3.0.0 Using library: libvirt 3.0.0 Using API: QEMU 3.0.0 Running hypervisor: QEMU 2.8.1 ``` ``` lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 48 On-line CPU(s) list: 0-47 Thread(s) per core: 1 Core(s) per socket: 12 Socket(s): 4 NUMA node(s): 8 Vendor ID: AuthenticAMD CPU family: 16 Model: 9 Model name: AMD Opteron(tm) Processor 6174 ``` - create an instance with webvirtcloud using "custom" option, checked "host-model" - Start it. - It successfully started. - Generated XML: ```xml <features> <acpi/> <apic/> <pae/> </features> <cpu mode='custom' match='exact'> <model fallback='forbid'>Opteron_G3</model> <vendor>AMD</vendor> <feature policy='require' name='vme'/> <feature policy='require' name='ht'/> <feature policy='require' name='mmxext'/> <feature policy='require' name='fxsr_opt'/> <feature policy='require' name='pdpe1gb'/> <feature policy='require' name='3dnowext'/> <feature policy='require' name='3dnow'/> <feature policy='require' name='cmp_legacy'/> <feature policy='require' name='extapic'/> <feature policy='require' name='cr8legacy'/> <feature policy='require' name='3dnowprefetch'/> <feature policy='require' name='osvw'/> <feature policy='require' name='ibs'/> <feature policy='require' name='skinit'/> <feature policy='require' name='wdt'/> <feature policy='require' name='nodeid_msr'/> </cpu> ``` - create an instance with webvirtcloud using "custom" option, non-checked "host-model" - Start it. - It successfully started. - Generated XML: ```xml <features> <acpi/> <apic/> <pae/> </features> ``` i cannot reproduce your problem. I do not know what is the difference. i think the bug you specified is special to you. sorry have a nice day
Author
Owner

@4920441 commented on GitHub (Apr 25, 2019):

Hi,
thanks for testing,

but maybe its because of your G3 Opteron.

I got a G4 one (6276) and the only other incident mentioned in the link in the first post got a G5 Opteron (I assume 63xx)...

whatever:-) I think this problem is more related to the underlying livirt configuration than webvirtcloud.

As long as webvirtcloud does not mess with the libvirt default xml config, it should be doable, I think.

Cheers,

4920441

<!-- gh-comment-id:486776131 --> @4920441 commented on GitHub (Apr 25, 2019): Hi, thanks for testing, but maybe its because of your G3 Opteron. I got a G4 one (6276) and the only other incident mentioned in the link in the first post got a G5 Opteron (I assume 63xx)... whatever:-) I think this problem is more related to the underlying livirt configuration than webvirtcloud. As long as webvirtcloud does not mess with the libvirt default xml config, it should be doable, I think. Cheers, 4920441
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtcloud#154
No description provided.