ganeti / ganeti

Ganeti is a virtual machine cluster management tool built on top of existing virtualization technologies such as Xen or KVM and other open source software.
http://www.ganeti.org
BSD 2-Clause "Simplified" License
495 stars 110 forks source link

Raw Xen hypervisors parameters #1593

Open davidassigbi opened 3 years ago

davidassigbi commented 3 years ago

I am running ganeti 3.0. The latest version from Debian buster backports.

I am only used to Xen as a type 1 hypervisor. Usually in order to create a VM (PVM / HVM) there are a ton of options a ton of options one can tweak to have the desired config for the Vm. However, I think ganeti currently only some options to be passed as hypervisor parameters and those are the one that get written in the Xen generated configuration file.

For example the parameter nestedhvm which enables nested virtualization is not supported. I would like to know If there is actually a way to get some parameters like nestedhvm inside the final configuration file.

For example, I am thinking of maybe a raw JSON object that could be passed to gnt-instance as hypervisor additional parameters that will just get copied inside that final config file without the need of a special processing.

Thanks !

zen2 commented 3 years ago

I don't use xen but with kvm/qemu you can set additional options at cluster level as at instance level. At cluster level so that will be use by any instances, I'm using for example this:

Hypervisor parameters:
  kvm:
    kvm_extra: -device virtio-rng-pci,bus=pci.0,addr=0x1e,max-bytes=1024,period=1000

To get this, I have to set it like this: gnt-cluster modify -H kvm:kvm_extra='-device virtio-rng-pci\,bus=pci.0\,addr=0x1e\,max-bytes=1024\,period=1000'

I suppose that you can do the equivalent for xen. Can you check it with: gnt-cluster info | grep xen_extra

davidassigbi commented 3 years ago

Thanks for the suggestion but unfortunately, there is no such parameters for Xen hypervisor.

Trying what you suggested also shows nothing related to any extra configuration options

# gnt-cluster info
Cluster name: master.id2real.lab
Default hypervisor: xen-hvm
Enabled hypervisors: xen-hvm
Hypervisor parameters: 
  xen-hvm: 
    acpi: True
    blockdev_prefix: xvd
    boot_order: cd
    cdrom_image_path: 
    cpu_cap: 0
    cpu_mask: all
    cpu_weight: 256
    cpuid: 
    device_model: /usr/bin/qemu-system-x86_64
    disk_type: paravirtual
    kernel_path: /usr/lib/grub-xen/grub-x86_64-xen.bin
    migration_mode: non-live
    migration_port: 8002
    nic_type: paravirtual
    pae: True
    pci_pass: 
    reboot_behavior: reboot
    soundhw: 
    use_localtime: False
    vif_script: 
    vif_type: 
    viridian: False
    vnc_bind_address: 0.0.0.0
    vnc_password_file: /etc/ganeti/vnc-cluster-password
    xen_cmd: xl
OS-specific hypervisor parameters: 
OS parameters: 

Plus I saw I there are some interesting parameters on the instance object.

$ gnt-instance list-fields | grep -E 'custom|extra'
custom_beparams                   Custom       CustomBackendParameters           Custom backend parameters
custom_hvparams                   Custom       CustomHypervisorParameters        Custom hypervisor parameters
custom_nicparams                  Custom       CustomNicParameters               Custom network interface parameters
custom_osparams                   Custom       CustomOpSysParameters             Custom operating system parameters
hv/extra_cgroups                  Custom       hv/extra_cgroups                  The "extra_cgroups" hypervisor parameter
hv/extra_config                   Custom       hv/extra_config                   The "extra_config" hypervisor parameter
hv/kvm_extra                      Custom       hv/kvm_extra                      The "kvm_extra" hypervisor parameter

I can see that normally I can set some 'extra_config' or 'custom_hvparams' on an instance but when I try to set the extra_config on a VM that is using the Xen hypervisor, it says this

$ gnt-instance modify --hypervisor-parameters extra_config="nestedhvm=1" david_vm1
Unhandled Ganeti error: Parameter 'extra_config' is not supported

As attended, trying to modify the extra config cluster wide for the xen-hvm hypervisor is not working either.

$ gnt-cluster modify --hypervisor-parameters xen-hvm:extra_config='nested_hvm=1'
Unhandled Ganeti error: Parameter 'extra_config' is not supported

Thanks for your help.