Skip to content

Commit

Permalink
Minor changes based on running through the lab
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfgang Kulhanek authored and Wolfgang Kulhanek committed Dec 10, 2024
1 parent f25a148 commit cf6bf77
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 15 deletions.
3 changes: 2 additions & 1 deletion content/modules/ROOT/pages/pxe-osv-01.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
6 changes: 3 additions & 3 deletions content/modules/ROOT/pages/pxe-osv-02.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
29 changes: 24 additions & 5 deletions content/modules/ROOT/pages/pxe-osv-03.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand All @@ -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.
17 changes: 13 additions & 4 deletions content/modules/ROOT/pages/pxe-osv-04.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,24 @@ 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.
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

Expand Down Expand Up @@ -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!
8 changes: 6 additions & 2 deletions content/modules/ROOT/pages/pxe-osv-05.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down

0 comments on commit cf6bf77

Please sign in to comment.