Skip to content

Commit 971d0a5

Browse files
authored
Merge pull request #70090 from RamLavi/update_image_creation_scripts
[Virt] DPDK Checkup: Update image building scripts
2 parents ba773e7 + 5297e02 commit 971d0a5

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

modules/virt-building-vm-containerdisk-image.adoc

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ description = "Image to use with the DPDK checkup"
5555
version = "0.0.1"
5656
distro = "rhel-87"
5757

58+
[[customizations.user]]
59+
name = "root"
60+
password = "redhat"
61+
5862
[[packages]]
5963
name = "dpdk"
6064

@@ -68,7 +72,7 @@ name = "driverctl"
6872
name = "tuned-profiles-cpu-partitioning"
6973

7074
[customizations.kernel]
71-
append = "default_hugepagesz=1GB hugepagesz=1G hugepages=8 isolcpus=2-7"
75+
append = "default_hugepagesz=1GB hugepagesz=1G hugepages=1"
7276

7377
[customizations.services]
7478
disabled = ["NetworkManager-wait-online", "sshd"]
@@ -108,28 +112,26 @@ EOF
108112
[source,terminal]
109113
----
110114
$ cat <<EOF >customize-vm
111-
echo isolated_cores=2-7 > /etc/tuned/cpu-partitioning-variables.conf
112-
tuned-adm profile cpu-partitioning
115+
#!/bin/bash
116+
117+
# Setup hugepages mount
118+
mkdir -p /mnt/huge
119+
echo "hugetlbfs /mnt/huge hugetlbfs defaults,pagesize=1GB 0 0" >> /etc/fstab
120+
121+
# Create vfio-noiommu.conf
113122
echo "options vfio enable_unsafe_noiommu_mode=1" > /etc/modprobe.d/vfio-noiommu.conf
114-
EOF
115-
----
116-
+
117-
[source,terminal]
118-
----
119-
$ cat <<EOF >first-boot
120-
driverctl set-override 0000:06:00.0 vfio-pci
121-
driverctl set-override 0000:07:00.0 vfio-pci
122123

123-
mkdir /mnt/huge
124-
mount /mnt/huge --source nodev -t hugetlbfs -o pagesize=1GB
124+
# Enable guest-exec,guest-exec-status on the qemu-guest-agent configuration
125+
sed -i '/^BLACKLIST_RPC=/ { s/guest-exec-status//; s/guest-exec//g }' /etc/sysconfig/qemu-ga
126+
sed -i '/^BLACKLIST_RPC=/ { s/,\+/,/g; s/^,\|,$//g }' /etc/sysconfig/qemu-ga
125127
EOF
126128
----
127129

128130
. Use the `virt-customize` tool to customize the image generated by the image builder tool:
129131
+
130132
[source,terminal]
131133
----
132-
$ virt-customize -a <UUID>.qcow2 --run=customize-vm --firstboot=first-boot --selinux-relabel
134+
$ virt-customize -a <UUID>.qcow2 --run=customize-vm --selinux-relabel
133135
----
134136

135137
. To create a Dockerfile that contains all the commands to build the container disk image, enter the following command:
@@ -138,7 +140,7 @@ $ virt-customize -a <UUID>.qcow2 --run=customize-vm --firstboot=first-boot --sel
138140
----
139141
$ cat << EOF > Dockerfile
140142
FROM scratch
141-
COPY <uuid>-disk.qcow2 /disk/
143+
COPY --chown=107:107 <uuid>-disk.qcow2 /disk/
142144
EOF
143145
----
144146
+
@@ -160,4 +162,4 @@ $ podman build . -t dpdk-rhel:latest
160162
$ podman push dpdk-rhel:latest
161163
----
162164

163-
. Provide a link to the container disk image in the `spec.param.vmContainerDiskImage` attribute in the DPDK checkup config map.
165+
. Provide a link to the container disk image in the `spec.param.vmUnderTestContainerDiskImage` attribute in the DPDK checkup config map.

0 commit comments

Comments
 (0)