Skip to content

Commit

Permalink
Feedback Lab 2
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-pona committed Sep 4, 2024
1 parent 526db12 commit 57ab36e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions content/en/docs/02/21_create-vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 57ab36e

Please sign in to comment.