Skip to content

Commit

Permalink
docs: improve qemu command line (#5540)
Browse files Browse the repository at this point in the history
The suggested qemu command line in our local execution example
is rather old.

Change the discouraged -hd* options to the new
-device instead.

Further add a chance to use KVM acceleration to speed up the
example.

Finally we had several occasions to be working on x86 only.
We dropped arguments that can not work on cross-arch and
furthermore added a hint at how one could again native
performance on these platforms.

Fixes GH-5050
  • Loading branch information
cpaelzer authored Jul 24, 2024
1 parent bb4b7c0 commit 02beb9a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
11 changes: 9 additions & 2 deletions doc/rtd/howto/run_cloud_init_locally.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ Download an Ubuntu image to run:
wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
.. note::
This example uses emulated CPU instructions on non-x86 hosts, so it may be
slow. To make it faster on non-x86 architectures, one can change the image
type and :spelling:ignore:`qemu-system-<arch>` command name to match the
architecture of your host machine.

Boot the image with the ISO attached
------------------------------------

Expand All @@ -78,8 +84,9 @@ Boot the cloud image with our configuration, :file:`seed.img`, to QEMU:
.. code-block:: shell-session
$ qemu-system-x86_64 -m 1024 -net nic -net user \
-hda jammy-server-cloudimg-amd64.img \
-hdb seed.img
-drive file=jammy-server-cloudimg-amd64.img,index=0,format=qcow2,media=disk \
-drive file=seed.img,index=1,media=cdrom \
-machine accel=kvm:tcg
The now-booted image will allow for login using the password provided above.

Expand Down
7 changes: 6 additions & 1 deletion doc/rtd/tutorial/qemu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ server image using :command:`wget`:
$ wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
.. note::
This example uses emulated CPU instructions on non-x86 hosts, so it may be
slow. To make it faster on non-x86 architectures, one can change the image
type and :spelling:ignore:`qemu-system-<arch>` command name to match the
architecture of your host machine.

Define our user data
====================

Expand Down Expand Up @@ -203,7 +209,6 @@ take a few moments to complete.
-net nic \
-net user \
-machine accel=kvm:tcg \
-cpu host \
-m 512 \
-nographic \
-hda jammy-server-cloudimg-amd64.img \
Expand Down
1 change: 1 addition & 0 deletions tools/.github-cla-signers
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ citrus-it
cjp256
CodeBleu
Conan-Kudo
cpaelzer
cvstealth
dankenigsberg
dankm
Expand Down

0 comments on commit 02beb9a

Please sign in to comment.