[Starlingx-discuss] Fedora Libvirt patch - required to deploy on Fedora 28, probably other non-ubuntu specific

Michel Thebeau michel.thebeau at windriver.com
Mon Sep 10 17:28:21 UTC 2018


Hi Scott,

Please add me to the review when you get it to gerrit.  I've made 
similar changes.

I recently touched xml in this commits under review:
https://review.openstack.org/#/c/601276/ (deployment: libvirt: remove 
macs from xml)
https://review.openstack.org/#/c/601278/ (deployment: libvirt: remove 
pci, bus, controllers)
https://review.openstack.org/#/c/601279/ (deployment: libvirt: update 
machine type and model)


On 2018-09-09 11:57 PM, scottk at optimcloud.com wrote:
> sending in my fedora modifications needed to spin up on Fedora 28, removing the Ubuntu specific items,
> created on my local tree with git format-patch -1 437353d3b108e7a92c0d5c48c81d334f07940dc3 (the git rev is my specific commit to my local tree)
>
> noted the machine='pc-i440fx-xenial' and seclabel pieces are not required in Fedora, also note in the docs


I recommend being explicit about the hardware models (machine and cpu 
model), in order to stabilize testing across host machines.  I want to 
suggest using q35 because it is newer.  But 'pc-i440fx-xenial' is listed 
as default in "kvm -M ?"




>
> Installing Requirements and Dependencies
> Install the required packages and configure QEMU. This only needs to be done once per host. (NOTE: this script only knows about Ubuntu at this time):
>
> $SCRIPTS/install_packages.sh
>
> the above breaks permissions on libvirt in Fedora and most likely others rendering it useless
>
> we dont use
> user = "root"
> group = "root"
>
> and obviously, we (IMHO) shouldnt be running it as group root anyway, in Fedora there is a libvirt group
> 0001-fixup-for-fedora.patch
>  From 437353d3b108e7a92c0d5c48c81d334f07940dc3 Mon Sep 17 00:00:00 2001
> From: OutBack Dingo <outbackdingo at gmail.com>
> Date: Mon, 10 Sep 2018 05:46:58 +0200
> Subject: [PATCH] fixup for fedora
>
> ---
>   deployment/libvirt/compute.xml | 6 +-----
>   deployment/libvirt/controller.xml | 6 +-----
>   deployment/libvirt/controller_allinone.xml | 6 +-----
>   deployment/libvirt/setup_allinone.sh | 4 ----
>   4 files changed, 3 insertions(+), 19 deletions(-)
>
> diff --git a/deployment/libvirt/compute.xml b/deployment/libvirt/compute.xml
> index 85474c0..4bdc812 100644
> --- a/deployment/libvirt/compute.xml
> +++ b/deployment/libvirt/compute.xml
> @@ -7,7 +7,7 @@
>   <partition>/machine</partition>
>   </resource>
>   <os>
> - <type arch='x86_64' machine='pc-i440fx-xenial'>hvm</type>
> + <type arch='x86_64'>hvm</type>

I'd want to be explicit with a machine here so that all users run the 
same emulated hardware.


>   </os>
>   <features>
>   <acpi/>
> @@ -108,8 +108,4 @@
>   <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
>   </memballoon>
>   </devices>
> - <seclabel type='dynamic' model='apparmor' relabel='yes'>
> - <label>libvirt-608ab5c8-8d11-4bdd-885f-f8b5fee12ff0</label>
> - <imagelabel>libvirt-608ab5c8-8d11-4bdd-885f-f8b5fee12ff0</imagelabel>
> - </seclabel>


libvirt will add it back into the DOMAIN xml when the domain is defined, 
so I agree that one would not want it in the xml template used to define 
the nodes.


M


>   </domain>
> diff --git a/deployment/libvirt/controller.xml b/deployment/libvirt/controller.xml
> index e346813..65c4d01 100644
> --- a/deployment/libvirt/controller.xml
> +++ b/deployment/libvirt/controller.xml
> @@ -7,7 +7,7 @@
>   <partition>/machine</partition>
>   </resource>
>   <os>
> - <type arch='x86_64' machine='pc-i440fx-xenial'>hvm</type>
> + <type arch='x86_64'>hvm</type>
>   </os>
>   <features>
>   <acpi/>
> @@ -122,9 +122,5 @@
>   <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
>   </memballoon>
>   </devices>
> - <seclabel type='dynamic' model='apparmor' relabel='yes'>
> - <label>libvirt-6afab2ba-0ed0-45cb-b1bd-985e211a48de</label>
> - <imagelabel>libvirt-6afab2ba-0ed0-45cb-b1bd-985e211a48de</imagelabel>
> - </seclabel>
>   </domain>
> diff --git a/deployment/libvirt/controller_allinone.xml b/deployment/libvirt/controller_allinone.xml
> index 9249183..83e8fe6 100644
> --- a/deployment/libvirt/controller_allinone.xml
> +++ b/deployment/libvirt/controller_allinone.xml
> @@ -7,7 +7,7 @@
>   <partition>/machine</partition>
>   </resource>
>   <os>
> - <type arch='x86_64' machine='pc-i440fx-xenial'>hvm</type>
> + <type arch='x86_64'>hvm</type>
>   </os>
>   <features>
>   <acpi/>
> @@ -122,9 +122,5 @@
>   <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
>   </memballoon>
>   </devices>
> - <seclabel type='dynamic' model='apparmor' relabel='yes'>
> - <label>libvirt-6afab2ba-0ed0-45cb-b1bd-985e211a48de</label>
> - <imagelabel>libvirt-6afab2ba-0ed0-45cb-b1bd-985e211a48de</imagelabel>
> - </seclabel>
>   </domain>
> diff --git a/deployment/libvirt/setup_allinone.sh b/deployment/libvirt/setup_allinone.sh
> index b228efc..dcf1607 100755
> --- a/deployment/libvirt/setup_allinone.sh
> +++ b/deployment/libvirt/setup_allinone.sh
> @@ -28,10 +28,6 @@ fi
>   ISOIMAGE=$(readlink -f "$ISOIMAGE")
>   FILETYPE=$(file --mime-type -b ${ISOIMAGE})
> -if ([ "$FILETYPE" != "application/x-iso9660-image" ]); then
> - echo "$ISOIMAGE is not an application/x-iso9660-image type"
> - exit -1
> -fi



>   BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
>   CONTROLLER=${CONTROLLER:-controller-allinone}
>
>
> _______________________________________________
> Starlingx-discuss mailing list
> Starlingx-discuss at lists.starlingx.io
> http://lists.starlingx.io/cgi-bin/mailman/listinfo/starlingx-discuss





More information about the Starlingx-discuss mailing list