summaryrefslogtreecommitdiff
path: root/vmadm.md
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-02-27 07:54:40 +0200
committerLars Wirzenius <liw@liw.fi>2021-02-28 12:24:08 +0200
commit1c5c97532c91faf8a59bbe7ebcfc645f653db697 (patch)
tree5d690b3e826472c8515710dce3d9bd256106b249 /vmadm.md
parent98c482d7903d059a6598a6e7280f0e7b431eac29 (diff)
downloadvmadm-1c5c97532c91faf8a59bbe7ebcfc645f653db697.tar.gz
feat: export cloud-init config, set SSH host keys
Diffstat (limited to 'vmadm.md')
-rw-r--r--vmadm.md105
1 files changed, 84 insertions, 21 deletions
diff --git a/vmadm.md b/vmadm.md
index a63370c..9d05b2a 100644
--- a/vmadm.md
+++ b/vmadm.md
@@ -1,25 +1,6 @@
-# Create a virtual machine
-
-This scenario verifies that vmadm can create a virtual machine and
-that the user can log into it as root via SSH after it has booted.
-This requires that the environment it set up so that virtual machines
-can be addressed by name.
-
-~~~scenario
-given an installed vmadm
-given file smoke.yaml
-given file .ssh/id_rsa from ssh_key
-given file .ssh/id_rsa.pub from ssh_key_pub
-given file .ssh/config from ssh_config
-when I invoke vmadm new smoke.yaml
-when I invoke ssh -F .ssh/config debian@smoke hostname
-then stdout contains "smoke"
-when I invoke ssh -F .ssh/config debian@smoke df -h /
-then stdout contains "4.9G"
-when I invoke ssh -F .ssh/config debian@smoke free -m
-then stdout contains "1997"
-~~~
+# Data files for scenarios
+This section has some data files used by scenarios.
~~~{#smoke.yaml .file .yaml}
name: smoke
@@ -74,6 +55,88 @@ host *
passwordauthentication=no
~~~
+# Cloud-init configuration
+
+This scenario verifies that vmadm creates the cloud-init configuration
+correctly.
+
+~~~scenario
+given an installed vmadm
+given file init.yaml
+given file .ssh/id_rsa.pub from init_ssh_key_pub
+given file expected/meta-data from init-metadata
+given file expected/user-data from init-userdata
+when I invoke vmadm cloud-init init.yaml actual
+then directories actual and expected are identical
+~~~
+
+~~~{#init.yaml .file .yaml}
+name: init-test
+ssh_key_files:
+ - .ssh/id_rsa.pub
+rsa_host_key: rsa-private
+rsa_host_cert: rsa-certificate
+dsa_host_key: dsa-private
+dsa_host_cert: dsa-certificate
+ecdsa_host_key: ecdsa-private
+ecdsa_host_cert: ecdsa-certificate
+ed25519_host_key: ed25519-private
+ed25519_host_cert: ed25519-certificate
+base: /home/liw/tmp/debian-10-openstack-amd64.qcow2
+image: init.qcow2
+image_size_gib: 5
+memory_mib: 2048
+cpus: 1
+~~~
+
+~~~{#init_ssh_key_pub .file}
+init-authz-key
+~~~
+
+~~~{#init-metadata .file}
+# Amazon EC2 style metadata
+local-hostname: init-test
+~~~
+
+~~~{#init-userdata .file}
+#cloud-config
+ssh_authorized_keys:
+ - init-authz-key
+ssh_keys:
+ rsa_private: rsa-private
+ rsa_certificate: rsa-certificate
+ dsa_private: dsa-private
+ dsa_certificate: dsa-certificate
+ ecdsa_private: ecdsa-private
+ ecdsa_certificate: ecdsa-certificate
+ ed25519_private: ed25519-private
+ ed25519_certificate: ed25519-certificate
+~~~
+
+# Create a virtual machine
+
+This scenario verifies that vmadm can create a virtual machine and
+that the user can log into it as root via SSH after it has booted.
+This requires that the environment it set up so that virtual machines
+can be addressed by name.
+
+~~~scenario
+given an installed vmadm
+given file smoke.yaml
+given file .ssh/id_rsa from ssh_key
+given file .ssh/id_rsa.pub from ssh_key_pub
+given file .ssh/config from ssh_config
+when I invoke vmadm new smoke.yaml
+when I invoke ssh -F .ssh/config debian@smoke hostname
+then stdout contains "smoke"
+when I invoke ssh -F .ssh/config debian@smoke df -h /
+then stdout contains "4.9G"
+when I invoke ssh -F .ssh/config debian@smoke free -m
+then stdout contains "1997"
+~~~
+
+
+
# Colophon