From cf6bf772c2ac818e0f8b3901c5d3c0ef889d2abe Mon Sep 17 00:00:00 2001 From: Wolfgang Kulhanek Date: Tue, 10 Dec 2024 15:46:25 +0100 Subject: [PATCH] Minor changes based on running through the lab --- content/modules/ROOT/pages/pxe-osv-01.adoc | 3 ++- content/modules/ROOT/pages/pxe-osv-02.adoc | 6 ++--- content/modules/ROOT/pages/pxe-osv-03.adoc | 29 ++++++++++++++++++---- content/modules/ROOT/pages/pxe-osv-04.adoc | 17 ++++++++++--- content/modules/ROOT/pages/pxe-osv-05.adoc | 8 ++++-- 5 files changed, 48 insertions(+), 15 deletions(-) diff --git a/content/modules/ROOT/pages/pxe-osv-01.adoc b/content/modules/ROOT/pages/pxe-osv-01.adoc index d1d2917..6345ee3 100644 --- a/content/modules/ROOT/pages/pxe-osv-01.adoc +++ b/content/modules/ROOT/pages/pxe-osv-01.adoc @@ -282,6 +282,7 @@ We can install the HyperConverged CR using the following command: [source,sh,role=execute] ---- cat << EOF | oc apply -f - +--- apiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: @@ -348,4 +349,4 @@ https://docs.openshift.com/container-platform/4.16/virt/storage/virt-configuring documentation^]. -With Portworx and OpenShift Virtualization installed and configured, we are now ready to move on to the next lesson. +With Portworx and OpenShift Virtualization installed and configured, we are now ready to move on to the next lab. diff --git a/content/modules/ROOT/pages/pxe-osv-02.adoc b/content/modules/ROOT/pages/pxe-osv-02.adoc index 815ee46..f50450d 100644 --- a/content/modules/ROOT/pages/pxe-osv-02.adoc +++ b/content/modules/ROOT/pages/pxe-osv-02.adoc @@ -20,8 +20,6 @@ ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N "" [source,sh,role=execute] ---- -ID_RSA_PUB=$(cat ~/.ssh/id_rsa.pub) - cat << EOF | oc apply -f - --- apiVersion: v1 @@ -99,7 +97,9 @@ Once the VM is running we can log into this VM using this command (if you do so [source,sh,role=execute] ---- -virtctl ssh cloud-user@centos-stream9-example -i ~/.ssh/id_rsa -t "-o StrictHostKeyChecking=no" +virtctl ssh cloud-user@centos-stream9-example \ + -i ~/.ssh/id_rsa \ + -t "-o StrictHostKeyChecking=no" ---- == Step 2 - Deploy a Virtual Machine using the Openshift Console diff --git a/content/modules/ROOT/pages/pxe-osv-03.adoc b/content/modules/ROOT/pages/pxe-osv-03.adoc index df6a2cd..2e8da7b 100644 --- a/content/modules/ROOT/pages/pxe-osv-03.adoc +++ b/content/modules/ROOT/pages/pxe-osv-03.adoc @@ -11,14 +11,20 @@ Let's write some data to a file: [source,sh,role=execute] ---- -virtctl ssh cloud-user@centos-stream9-example -i ~/.ssh/id_rsa -t "-o StrictHostKeyChecking=no" -c 'echo "Redhat was here" > ~/text' +virtctl ssh cloud-user@centos-stream9-example \ + -i ~/.ssh/id_rsa \ + -t "-o StrictHostKeyChecking=no" \ + -c 'echo "Red Hat was here" > ~/text' ---- We can read our file at any time by running: [source,sh,role=execute] ---- -virtctl ssh cloud-user@centos-stream9-example -i ~/.ssh/id_rsa -t "-o StrictHostKeyChecking=no" -c 'cat ~/text' +virtctl ssh cloud-user@centos-stream9-example \ + -i ~/.ssh/id_rsa \ + -t "-o StrictHostKeyChecking=no" \ + -c 'cat ~/text' ---- == Step 2 - Test Live Migrations @@ -71,7 +77,10 @@ Let's check to make sure our data is still there: [source,sh,role=execute] ---- -virtctl ssh cloud-user@centos-stream9-example -i ~/.ssh/id_rsa -t "-o StrictHostKeyChecking=no" -c 'cat ~/text' +virtctl ssh cloud-user@centos-stream9-example \ + -i ~/.ssh/id_rsa \ + -t "-o StrictHostKeyChecking=no" \ + -c 'cat ~/text' ---- == Step 3 - Providing HA @@ -116,9 +125,16 @@ MongoDB pod: [source,sh,role=execute] ---- -sudo reboot +reboot ---- +==== +[WARNING] +It is possible that your `showroom` lab interface (where you are reading these instructions) happens to be running on the node that you just rebooted. In that case the terminal on the right will disconnect. You will need to refresh your window until OpenShift notices that the node is down and re-schedules the showroom pod to an available node. + +To speed up the re-creation of the pod you can also find the showroom pod in the showroom namespace and delete the currently running pod. +==== + Let's watch our VM and pod status in the default namespace: [source,sh,role=execute] @@ -136,7 +152,10 @@ Let's check to make sure our data is still there: [source,sh,role=execute] ---- -virtctl ssh cloud-user@centos-stream9-example -i ~/.ssh/id_rsa -t "-o StrictHostKeyChecking=no" -c 'cat ~/text' +virtctl ssh cloud-user@centos-stream9-example \ + -i ~/.ssh/id_rsa \ + -t "-o StrictHostKeyChecking=no" \ + -c 'cat ~/text' ---- You are ready to move to the next lab. diff --git a/content/modules/ROOT/pages/pxe-osv-04.adoc b/content/modules/ROOT/pages/pxe-osv-04.adoc index 78fe44a..534b344 100644 --- a/content/modules/ROOT/pages/pxe-osv-04.adoc +++ b/content/modules/ROOT/pages/pxe-osv-04.adoc @@ -66,7 +66,10 @@ Let's "accidently" delete an important file: [source,sh,role=execute] ---- -virtctl ssh cloud-user@centos-stream9-example -i ~/.ssh/id_rsa -t "-o StrictHostKeyChecking=no" -c 'sudo rm /etc/fstab' +virtctl ssh cloud-user@centos-stream9-example \ + -i ~/.ssh/id_rsa \ + -t "-o StrictHostKeyChecking=no" \ + -c 'sudo rm /etc/fstab' ---- Oh no! `/etc/fstab` is an important file for the operation of our linux system. @@ -74,10 +77,13 @@ We can verify that the file is indeed missing by running: [source,sh,role=execute] ---- -virtctl ssh cloud-user@centos-stream9-example -i ~/.ssh/id_rsa -t "-o StrictHostKeyChecking=no" -c 'cat /etc/fstab' +virtctl ssh cloud-user@centos-stream9-example \ + -i ~/.ssh/id_rsa \ + -t "-o StrictHostKeyChecking=no" \ + -c 'cat /etc/fstab' ---- -Let's fix our VM +Let's fix our VM. === Task 4: Restore our snapshot @@ -127,7 +133,10 @@ our fstab file is back in place: [source,sh,role=execute] ---- -virtctl ssh cloud-user@centos-stream9-example -i ~/.ssh/id_rsa -t "-o StrictHostKeyChecking=no" -c 'cat /etc/fstab' +virtctl ssh cloud-user@centos-stream9-example \ + -i ~/.ssh/id_rsa \ + -t "-o StrictHostKeyChecking=no" \ + -c 'cat /etc/fstab' ---- We can now see that the contents of the `/etc/fstab` file has been restored! diff --git a/content/modules/ROOT/pages/pxe-osv-05.adoc b/content/modules/ROOT/pages/pxe-osv-05.adoc index e8f05c8..b1b47f2 100644 --- a/content/modules/ROOT/pages/pxe-osv-05.adoc +++ b/content/modules/ROOT/pages/pxe-osv-05.adoc @@ -137,7 +137,8 @@ We will apply that label to our virtual machine's PVC. [source,sh,role=execute] ---- -oc label pvc centos-stream9-autopilot-data-disk app=autopilot --overwrite +oc label pvc centos-stream9-autopilot-data-disk \ + app=autopilot --overwrite ---- [source,sh,role=execute] @@ -162,7 +163,10 @@ until virtctl ssh cloud-user@centos-stream9-autopilot -i ~/.ssh/id_rsa -t "-o St done # Set up the filesystem and mount the disk as /data -virtctl ssh cloud-user@centos-stream9-autopilot -i ~/.ssh/id_rsa -t "-o StrictHostKeyChecking=no" -c '(echo g; echo n; echo 1; echo ; echo ; echo w) | sudo fdisk /dev/vdb && sudo mkfs.ext4 /dev/vdb1 && sudo mkdir /data && sudo mount /dev/vdb1 /data' +virtctl ssh cloud-user@centos-stream9-autopilot \ + -i ~/.ssh/id_rsa \ + -t "-o StrictHostKeyChecking=no" \ + -c '(echo g; echo n; echo 1; echo ; echo ; echo w) | sudo fdisk /dev/vdb && sudo mkfs.ext4 /dev/vdb1 && sudo mkdir /data && sudo mount /dev/vdb1 /data' ---- == Task 5: Add some storage space