-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6873227
commit 024c9b6
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Libvirt cloud images | ||
|
||
``` | ||
touch network-config | ||
touch meta-data | ||
cat >user-data <<EOF | ||
#cloud-config | ||
password: password | ||
chpasswd: | ||
expire: False | ||
ssh_pwauth: True | ||
EOF | ||
``` | ||
|
||
``` | ||
wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img | ||
$ qemu-img info jammy-server-cloudimg-amd64.img | ||
image: jammy-server-cloudimg-amd64.img | ||
file format: qcow2 | ||
virtual size: 2.2 GiB (2361393152 bytes) | ||
disk size: 620 MiB | ||
cluster_size: 65536 | ||
Format specific information: | ||
compat: 0.10 | ||
compression type: zlib | ||
refcount bits: 16 | ||
``` | ||
|
||
``` | ||
virt-install \ | ||
--name cloud-init-001 \ | ||
--memory 4000 \ | ||
--noreboot \ | ||
--os-variant detect=on,name=ubuntujammy \ | ||
--disk=size=10,backing_store="$(pwd)/jammy-server-cloudimg-amd64.img" \ | ||
--cloud-init user-data="$(pwd)/user-data,meta-data=$(pwd)/meta-data,network-config=$(pwd)/network-config" | ||
``` |