From 57ab36ed8a5bd6099573b99cad2fd215b46be88b Mon Sep 17 00:00:00 2001 From: Thomas Philipona Date: Wed, 4 Sep 2024 09:29:41 +0200 Subject: [PATCH] Feedback Lab 2 --- content/en/docs/02/21_create-vm.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/content/en/docs/02/21_create-vm.md b/content/en/docs/02/21_create-vm.md index 276eb14..327a42a 100644 --- a/content/en/docs/02/21_create-vm.md +++ b/content/en/docs/02/21_create-vm.md @@ -61,10 +61,14 @@ outside world. ### {{% task %}} Write your own VirtualMachine manifest -Create a file `vm_{{% param "labsubfolderprefix" %}}{{% param "labfoldernumber" %}}-firstvm.yaml` with the content yaml -content from above. Starting from the basic manifest you need to add a bootable disk for your vm and a network and -interface specification. The easiest way is to use an ephemeral `containerDisk` mountable as a volume. Regarding the -network we connect our VM to the underlying kubernetes default network. +Create a new empty file `~/{{% param "labsfoldername" %}}/{{% param "labsubfolderprefix" %}}{{% param "labfoldernumber" %}}/firstvm.yaml` and copy the `VirtualMachine` manifest from above as a starting point. Starting from the basic manifest you need to add a bootable disk for your vm and a network and interface specification. +To achieve that you need to specify the following parts in the `VirtualMachine` manifest: + +* `spec.template.spec.domain.devices` +* `spec.template.spec.networks` +* `spec.template.spec.volumes` + +The easiest way is to use an ephemeral `containerDisk` mountable as a volume. Regarding the network we connect our VM to the underlying kubernetes default network. ```yaml spec: @@ -91,7 +95,7 @@ spec: Make sure you implement the required parts for a container disk and the network interface specification in you VM manifest. {{% details title="Task Hint" %}} -Your yaml should look like this: +Your VirtualMachine yaml should look like this: ```yaml apiVersion: kubevirt.io/v1 kind: VirtualMachine @@ -133,7 +137,7 @@ spec: Since you have completed the yaml configuration for the VM it's now time to create it our VM in the kubernetes cluster. ```shell -kubectl create -f vm_{{% param "labsubfolderprefix" %}}{{% param "labfoldernumber" %}}-firstvm.yaml +kubectl create -f ~/{{% param "labsfoldername" %}}/{{% param "labsubfolderprefix" %}}{{% param "labfoldernumber" %}}/firstvm.yaml ``` The output should be: