diff --git a/docs/openshift/index.md b/docs/openshift/index.md index 981741f4..00af5497 100644 --- a/docs/openshift/index.md +++ b/docs/openshift/index.md @@ -57,6 +57,18 @@ the list below. - [Deleting your applications](applications/deleting-applications.md) +## Virtualization on OpenShift + +- [Introduction](virtualization/intro-virtualization-on-openshift.md) + +- [Getting Started](virtualization/getting-started.md) + +- [Running and Managing VMs](virtualization/running-and-managing-vms.md) + +- [Setting up Windows VM](virtualization/windows-vm.md) + +- [Storage](virtualization/storage.md) + ## Decommission OpenShift Resources - [Decommission OpenShift Resources](decommission/decommission-openshift-resources.md) diff --git a/docs/openshift/virtualization/getting-started.md b/docs/openshift/virtualization/getting-started.md new file mode 100644 index 00000000..a1ae166f --- /dev/null +++ b/docs/openshift/virtualization/getting-started.md @@ -0,0 +1,75 @@ +# Getting Started + +## Quick Getting Started Tour + +You can start exploring OpenShift Virtualization by taking tours in the OpenShift +Container Platform web console. + +1. Go to the [NERC's OpenShift Web Console](https://console.apps.shift.nerc.mghpcc.org). + +2. Click on the **Perspective Switcher** drop-down menu and select **Virtualization** +as shown below: + + ![Virtualization Perspective](images/virtualization-perspective.png) + + This short guided tour introduces several key aspects of using OpenShift Virtualization. + + There are **two ways** to start the tour: + + On the **Welcome to OpenShift Virtualization** dialog, click **Start Tour** as + shown below: + + ![OpenShift Virtualization Dialog](images/openshift-virtualization-dialog.png) + + **Or,** + + Go to **Virtualization** > **Overview** > **Settings** > **User** > + **Getting started resources** and click **Guided tour**. + +## Setting Up Your Environment + +The `virtctl` client is a command-line utility designed for managing OpenShift +Virtualization resources. To install the `virtctl` command-line interface (CLI) +tool, please follow the instructions in [this documentation](https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/virtualization/getting-started#installing-virtctl_virt-using-the-cli-tools). + +You can utilize `virtctl` information commands to perform various operations, as +outlined [here](https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/virtualization/getting-started#virt-virtctl-commands_virt-using-the-cli-tools). + +!!! note "Note" + + The virtual machine (VM) commands also apply to virtual machine instances (VMIs) + unless otherwise specified. + +## Set Up a Public SSH Key + +Before creating a virtual machine, we recommend that you configure the public SSH +key to your project. It will be saved in the project as a secret. You can configure +the public SSH key at a later time, but this is the easiest way. + +For a Linux-based volume, follow these steps to configure SSH: + +i. If you have not already added a public SSH key to your project, click the edit +icon beside **Authorized SSH key** in the **VirtualMachine details** section. + +ii. Select one of the following options: + +- **Use existing**: Select a secret from the secrets list. + +- **Add new**: Follow these steps: + + i. Browse to the public SSH key file or paste the file in the key field. + + ![Configure Public SSH Key](images/configure_SSH.png) + + !!! tips "Creating SSH Key Pair" + + You can generate an SSH key pair by running the `ssh-keygen` command. + + ii. Enter the secret name. + + iii. Optional: Select **Automatically apply this key to any new VirtualMachine + you create in this project**. + +iii. Click **Save**. + +--- diff --git a/docs/openshift/virtualization/images/VM_Actions_List_Stopped.png b/docs/openshift/virtualization/images/VM_Actions_List_Stopped.png new file mode 100644 index 00000000..2a4c03c7 Binary files /dev/null and b/docs/openshift/virtualization/images/VM_Actions_List_Stopped.png differ diff --git a/docs/openshift/virtualization/images/actions-icon-bar.png b/docs/openshift/virtualization/images/actions-icon-bar.png new file mode 100644 index 00000000..df96c655 Binary files /dev/null and b/docs/openshift/virtualization/images/actions-icon-bar.png differ diff --git a/docs/openshift/virtualization/images/add-boot-volume.png b/docs/openshift/virtualization/images/add-boot-volume.png new file mode 100644 index 00000000..c5067ba5 Binary files /dev/null and b/docs/openshift/virtualization/images/add-boot-volume.png differ diff --git a/docs/openshift/virtualization/images/add-disk.png b/docs/openshift/virtualization/images/add-disk.png new file mode 100644 index 00000000..48966c72 Binary files /dev/null and b/docs/openshift/virtualization/images/add-disk.png differ diff --git a/docs/openshift/virtualization/images/available-storageclasses.png b/docs/openshift/virtualization/images/available-storageclasses.png new file mode 100644 index 00000000..e817bd47 Binary files /dev/null and b/docs/openshift/virtualization/images/available-storageclasses.png differ diff --git a/docs/openshift/virtualization/images/bootable-os-pvcs.png b/docs/openshift/virtualization/images/bootable-os-pvcs.png new file mode 100644 index 00000000..ad02f369 Binary files /dev/null and b/docs/openshift/virtualization/images/bootable-os-pvcs.png differ diff --git a/docs/openshift/virtualization/images/catalog-instancetypes.png b/docs/openshift/virtualization/images/catalog-instancetypes.png new file mode 100644 index 00000000..a489d599 Binary files /dev/null and b/docs/openshift/virtualization/images/catalog-instancetypes.png differ diff --git a/docs/openshift/virtualization/images/clone-vm-dialog.png b/docs/openshift/virtualization/images/clone-vm-dialog.png new file mode 100644 index 00000000..176f5021 Binary files /dev/null and b/docs/openshift/virtualization/images/clone-vm-dialog.png differ diff --git a/docs/openshift/virtualization/images/cloud-init-dialog.png b/docs/openshift/virtualization/images/cloud-init-dialog.png new file mode 100644 index 00000000..27876509 Binary files /dev/null and b/docs/openshift/virtualization/images/cloud-init-dialog.png differ diff --git a/docs/openshift/virtualization/images/cloud-init-user-data.png b/docs/openshift/virtualization/images/cloud-init-user-data.png new file mode 100644 index 00000000..104f8eb3 Binary files /dev/null and b/docs/openshift/virtualization/images/cloud-init-user-data.png differ diff --git a/docs/openshift/virtualization/images/configure_SSH.png b/docs/openshift/virtualization/images/configure_SSH.png new file mode 100644 index 00000000..b136202d Binary files /dev/null and b/docs/openshift/virtualization/images/configure_SSH.png differ diff --git a/docs/openshift/virtualization/images/console-vm-vnc-connect.png b/docs/openshift/virtualization/images/console-vm-vnc-connect.png new file mode 100644 index 00000000..745caf34 Binary files /dev/null and b/docs/openshift/virtualization/images/console-vm-vnc-connect.png differ diff --git a/docs/openshift/virtualization/images/containerizing-kvm.png b/docs/openshift/virtualization/images/containerizing-kvm.png new file mode 100644 index 00000000..b8432ed8 Binary files /dev/null and b/docs/openshift/virtualization/images/containerizing-kvm.png differ diff --git a/docs/openshift/virtualization/images/cpu-and-mem.png b/docs/openshift/virtualization/images/cpu-and-mem.png new file mode 100644 index 00000000..020cdb0e Binary files /dev/null and b/docs/openshift/virtualization/images/cpu-and-mem.png differ diff --git a/docs/openshift/virtualization/images/create-pvc-form.png b/docs/openshift/virtualization/images/create-pvc-form.png new file mode 100644 index 00000000..e1e6c892 Binary files /dev/null and b/docs/openshift/virtualization/images/create-pvc-form.png differ diff --git a/docs/openshift/virtualization/images/create-pvc-with-data-upload-form.png b/docs/openshift/virtualization/images/create-pvc-with-data-upload-form.png new file mode 100644 index 00000000..225e2eaa Binary files /dev/null and b/docs/openshift/virtualization/images/create-pvc-with-data-upload-form.png differ diff --git a/docs/openshift/virtualization/images/create-pvc-with-form.png b/docs/openshift/virtualization/images/create-pvc-with-form.png new file mode 100644 index 00000000..211b3813 Binary files /dev/null and b/docs/openshift/virtualization/images/create-pvc-with-form.png differ diff --git a/docs/openshift/virtualization/images/create-snapshot-actions.png b/docs/openshift/virtualization/images/create-snapshot-actions.png new file mode 100644 index 00000000..0d6adb4e Binary files /dev/null and b/docs/openshift/virtualization/images/create-snapshot-actions.png differ diff --git a/docs/openshift/virtualization/images/create-vm-instancetype.png b/docs/openshift/virtualization/images/create-vm-instancetype.png new file mode 100644 index 00000000..afd013c6 Binary files /dev/null and b/docs/openshift/virtualization/images/create-vm-instancetype.png differ diff --git a/docs/openshift/virtualization/images/create-vm-popup.png b/docs/openshift/virtualization/images/create-vm-popup.png new file mode 100644 index 00000000..cb7bc5b0 Binary files /dev/null and b/docs/openshift/virtualization/images/create-vm-popup.png differ diff --git a/docs/openshift/virtualization/images/create-vm-with-yaml.png b/docs/openshift/virtualization/images/create-vm-with-yaml.png new file mode 100644 index 00000000..da5e1b97 Binary files /dev/null and b/docs/openshift/virtualization/images/create-vm-with-yaml.png differ diff --git a/docs/openshift/virtualization/images/custom-template-example.png b/docs/openshift/virtualization/images/custom-template-example.png new file mode 100644 index 00000000..f4ffd91a Binary files /dev/null and b/docs/openshift/virtualization/images/custom-template-example.png differ diff --git a/docs/openshift/virtualization/images/customize-disks-tab.png b/docs/openshift/virtualization/images/customize-disks-tab.png new file mode 100644 index 00000000..2479c54b Binary files /dev/null and b/docs/openshift/virtualization/images/customize-disks-tab.png differ diff --git a/docs/openshift/virtualization/images/customize-networking-interfaces-tab.png b/docs/openshift/virtualization/images/customize-networking-interfaces-tab.png new file mode 100644 index 00000000..45e17f98 Binary files /dev/null and b/docs/openshift/virtualization/images/customize-networking-interfaces-tab.png differ diff --git a/docs/openshift/virtualization/images/customize-scheduling-tab.png b/docs/openshift/virtualization/images/customize-scheduling-tab.png new file mode 100644 index 00000000..806e3726 Binary files /dev/null and b/docs/openshift/virtualization/images/customize-scheduling-tab.png differ diff --git a/docs/openshift/virtualization/images/customize-scripts-tab.png b/docs/openshift/virtualization/images/customize-scripts-tab.png new file mode 100644 index 00000000..458befdd Binary files /dev/null and b/docs/openshift/virtualization/images/customize-scripts-tab.png differ diff --git a/docs/openshift/virtualization/images/customize_parameters.png b/docs/openshift/virtualization/images/customize_parameters.png new file mode 100644 index 00000000..9b386046 Binary files /dev/null and b/docs/openshift/virtualization/images/customize_parameters.png differ diff --git a/docs/openshift/virtualization/images/dynamic-ssh-key-injection.png b/docs/openshift/virtualization/images/dynamic-ssh-key-injection.png new file mode 100644 index 00000000..3dbb33c0 Binary files /dev/null and b/docs/openshift/virtualization/images/dynamic-ssh-key-injection.png differ diff --git a/docs/openshift/virtualization/images/edit-disk.png b/docs/openshift/virtualization/images/edit-disk.png new file mode 100644 index 00000000..731cb0f5 Binary files /dev/null and b/docs/openshift/virtualization/images/edit-disk.png differ diff --git a/docs/openshift/virtualization/images/edit-instancetype.png b/docs/openshift/virtualization/images/edit-instancetype.png new file mode 100644 index 00000000..2ffe7663 Binary files /dev/null and b/docs/openshift/virtualization/images/edit-instancetype.png differ diff --git a/docs/openshift/virtualization/images/edit-labels-and-annotations.png b/docs/openshift/virtualization/images/edit-labels-and-annotations.png new file mode 100644 index 00000000..8c64f0e2 Binary files /dev/null and b/docs/openshift/virtualization/images/edit-labels-and-annotations.png differ diff --git a/docs/openshift/virtualization/images/edit-network-interface-dialog.png b/docs/openshift/virtualization/images/edit-network-interface-dialog.png new file mode 100644 index 00000000..101341d9 Binary files /dev/null and b/docs/openshift/virtualization/images/edit-network-interface-dialog.png differ diff --git a/docs/openshift/virtualization/images/edit-network-interfaces.png b/docs/openshift/virtualization/images/edit-network-interfaces.png new file mode 100644 index 00000000..47f11b85 Binary files /dev/null and b/docs/openshift/virtualization/images/edit-network-interfaces.png differ diff --git a/docs/openshift/virtualization/images/empty-volume-list.png b/docs/openshift/virtualization/images/empty-volume-list.png new file mode 100644 index 00000000..6dd45cde Binary files /dev/null and b/docs/openshift/virtualization/images/empty-volume-list.png differ diff --git a/docs/openshift/virtualization/images/ensure-start-vm-after-creation.png b/docs/openshift/virtualization/images/ensure-start-vm-after-creation.png new file mode 100644 index 00000000..c6cc2adb Binary files /dev/null and b/docs/openshift/virtualization/images/ensure-start-vm-after-creation.png differ diff --git a/docs/openshift/virtualization/images/events-tab.png b/docs/openshift/virtualization/images/events-tab.png new file mode 100644 index 00000000..293480e3 Binary files /dev/null and b/docs/openshift/virtualization/images/events-tab.png differ diff --git a/docs/openshift/virtualization/images/fedora-pvc.png b/docs/openshift/virtualization/images/fedora-pvc.png new file mode 100644 index 00000000..4fafa7f2 Binary files /dev/null and b/docs/openshift/virtualization/images/fedora-pvc.png differ diff --git a/docs/openshift/virtualization/images/from-template.png b/docs/openshift/virtualization/images/from-template.png new file mode 100644 index 00000000..cf969b93 Binary files /dev/null and b/docs/openshift/virtualization/images/from-template.png differ diff --git a/docs/openshift/virtualization/images/guest-login-vnc-console.png b/docs/openshift/virtualization/images/guest-login-vnc-console.png new file mode 100644 index 00000000..e6a6bd62 Binary files /dev/null and b/docs/openshift/virtualization/images/guest-login-vnc-console.png differ diff --git a/docs/openshift/virtualization/images/ip-interfaces.png b/docs/openshift/virtualization/images/ip-interfaces.png new file mode 100644 index 00000000..d785d8c9 Binary files /dev/null and b/docs/openshift/virtualization/images/ip-interfaces.png differ diff --git a/docs/openshift/virtualization/images/lsblk-command.png b/docs/openshift/virtualization/images/lsblk-command.png new file mode 100644 index 00000000..02430d91 Binary files /dev/null and b/docs/openshift/virtualization/images/lsblk-command.png differ diff --git a/docs/openshift/virtualization/images/metrics-tab.png b/docs/openshift/virtualization/images/metrics-tab.png new file mode 100644 index 00000000..4a4a6ea7 Binary files /dev/null and b/docs/openshift/virtualization/images/metrics-tab.png differ diff --git a/docs/openshift/virtualization/images/openshift-virtualization-dialog.png b/docs/openshift/virtualization/images/openshift-virtualization-dialog.png new file mode 100644 index 00000000..009ebcda Binary files /dev/null and b/docs/openshift/virtualization/images/openshift-virtualization-dialog.png differ diff --git a/docs/openshift/virtualization/images/openshift-virtualization.png b/docs/openshift/virtualization/images/openshift-virtualization.png new file mode 100644 index 00000000..eb085ba7 Binary files /dev/null and b/docs/openshift/virtualization/images/openshift-virtualization.png differ diff --git a/docs/openshift/virtualization/images/overview-tab.png b/docs/openshift/virtualization/images/overview-tab.png new file mode 100644 index 00000000..e95e1bc7 Binary files /dev/null and b/docs/openshift/virtualization/images/overview-tab.png differ diff --git a/docs/openshift/virtualization/images/paused-vm.png b/docs/openshift/virtualization/images/paused-vm.png new file mode 100644 index 00000000..9215ac06 Binary files /dev/null and b/docs/openshift/virtualization/images/paused-vm.png differ diff --git a/docs/openshift/virtualization/images/provision_with_custom_template.png b/docs/openshift/virtualization/images/provision_with_custom_template.png new file mode 100644 index 00000000..4c2c1d60 Binary files /dev/null and b/docs/openshift/virtualization/images/provision_with_custom_template.png differ diff --git a/docs/openshift/virtualization/images/remove.png b/docs/openshift/virtualization/images/remove.png new file mode 100644 index 00000000..9f6f3b85 Binary files /dev/null and b/docs/openshift/virtualization/images/remove.png differ diff --git a/docs/openshift/virtualization/images/remove2.png b/docs/openshift/virtualization/images/remove2.png new file mode 100644 index 00000000..2910a730 Binary files /dev/null and b/docs/openshift/virtualization/images/remove2.png differ diff --git a/docs/openshift/virtualization/images/restore-snapshot-actions.png b/docs/openshift/virtualization/images/restore-snapshot-actions.png new file mode 100644 index 00000000..ae74fdc4 Binary files /dev/null and b/docs/openshift/virtualization/images/restore-snapshot-actions.png differ diff --git a/docs/openshift/virtualization/images/restore-snapshot-dialog.png b/docs/openshift/virtualization/images/restore-snapshot-dialog.png new file mode 100644 index 00000000..7d13cbf2 Binary files /dev/null and b/docs/openshift/virtualization/images/restore-snapshot-dialog.png differ diff --git a/docs/openshift/virtualization/images/restore-snapshot-not-available.png b/docs/openshift/virtualization/images/restore-snapshot-not-available.png new file mode 100644 index 00000000..88c925ab Binary files /dev/null and b/docs/openshift/virtualization/images/restore-snapshot-not-available.png differ diff --git a/docs/openshift/virtualization/images/restored-vm-from-snapshot.png b/docs/openshift/virtualization/images/restored-vm-from-snapshot.png new file mode 100644 index 00000000..0e4cc556 Binary files /dev/null and b/docs/openshift/virtualization/images/restored-vm-from-snapshot.png differ diff --git a/docs/openshift/virtualization/images/rh-openshift-virt-storage-stack.png b/docs/openshift/virtualization/images/rh-openshift-virt-storage-stack.png new file mode 100644 index 00000000..0cebee60 Binary files /dev/null and b/docs/openshift/virtualization/images/rh-openshift-virt-storage-stack.png differ diff --git a/docs/openshift/virtualization/images/save-snapshot.png b/docs/openshift/virtualization/images/save-snapshot.png new file mode 100644 index 00000000..11632fbf Binary files /dev/null and b/docs/openshift/virtualization/images/save-snapshot.png differ diff --git a/docs/openshift/virtualization/images/select_project.png b/docs/openshift/virtualization/images/select_project.png new file mode 100644 index 00000000..3d898a56 Binary files /dev/null and b/docs/openshift/virtualization/images/select_project.png differ diff --git a/docs/openshift/virtualization/images/snapshot-operation-complete.png b/docs/openshift/virtualization/images/snapshot-operation-complete.png new file mode 100644 index 00000000..eea7d016 Binary files /dev/null and b/docs/openshift/virtualization/images/snapshot-operation-complete.png differ diff --git a/docs/openshift/virtualization/images/source-available-template.png b/docs/openshift/virtualization/images/source-available-template.png new file mode 100644 index 00000000..14e49d6a Binary files /dev/null and b/docs/openshift/virtualization/images/source-available-template.png differ diff --git a/docs/openshift/virtualization/images/start-vm.png b/docs/openshift/virtualization/images/start-vm.png new file mode 100644 index 00000000..fe19e6f3 Binary files /dev/null and b/docs/openshift/virtualization/images/start-vm.png differ diff --git a/docs/openshift/virtualization/images/stopped-vm.png b/docs/openshift/virtualization/images/stopped-vm.png new file mode 100644 index 00000000..c86bbab8 Binary files /dev/null and b/docs/openshift/virtualization/images/stopped-vm.png differ diff --git a/docs/openshift/virtualization/images/storage-managment.png b/docs/openshift/virtualization/images/storage-managment.png new file mode 100644 index 00000000..b16bb436 Binary files /dev/null and b/docs/openshift/virtualization/images/storage-managment.png differ diff --git a/docs/openshift/virtualization/images/sysprep-autoattend-available.png b/docs/openshift/virtualization/images/sysprep-autoattend-available.png new file mode 100644 index 00000000..d34d4ef4 Binary files /dev/null and b/docs/openshift/virtualization/images/sysprep-autoattend-available.png differ diff --git a/docs/openshift/virtualization/images/sysprep-dialog.png b/docs/openshift/virtualization/images/sysprep-dialog.png new file mode 100644 index 00000000..ccb5cd50 Binary files /dev/null and b/docs/openshift/virtualization/images/sysprep-dialog.png differ diff --git a/docs/openshift/virtualization/images/take-snapshot-of-vm.png b/docs/openshift/virtualization/images/take-snapshot-of-vm.png new file mode 100644 index 00000000..2249219d Binary files /dev/null and b/docs/openshift/virtualization/images/take-snapshot-of-vm.png differ diff --git a/docs/openshift/virtualization/images/take-snapshot-vm-action.png b/docs/openshift/virtualization/images/take-snapshot-vm-action.png new file mode 100644 index 00000000..6a7c4a47 Binary files /dev/null and b/docs/openshift/virtualization/images/take-snapshot-vm-action.png differ diff --git a/docs/openshift/virtualization/images/template-catalog-boot-source-available.png b/docs/openshift/virtualization/images/template-catalog-boot-source-available.png new file mode 100644 index 00000000..412b5495 Binary files /dev/null and b/docs/openshift/virtualization/images/template-catalog-boot-source-available.png differ diff --git a/docs/openshift/virtualization/images/template-info.png b/docs/openshift/virtualization/images/template-info.png new file mode 100644 index 00000000..2d8fefc3 Binary files /dev/null and b/docs/openshift/virtualization/images/template-info.png differ diff --git a/docs/openshift/virtualization/images/update-vm-configs.png b/docs/openshift/virtualization/images/update-vm-configs.png new file mode 100644 index 00000000..52c139fd Binary files /dev/null and b/docs/openshift/virtualization/images/update-vm-configs.png differ diff --git a/docs/openshift/virtualization/images/upload-data-to-pvc-form.png b/docs/openshift/virtualization/images/upload-data-to-pvc-form.png new file mode 100644 index 00000000..0d81246a Binary files /dev/null and b/docs/openshift/virtualization/images/upload-data-to-pvc-form.png differ diff --git a/docs/openshift/virtualization/images/virt-icon.png b/docs/openshift/virtualization/images/virt-icon.png new file mode 100644 index 00000000..dc1439e8 Binary files /dev/null and b/docs/openshift/virtualization/images/virt-icon.png differ diff --git a/docs/openshift/virtualization/images/virtualization-perspective.png b/docs/openshift/virtualization/images/virtualization-perspective.png new file mode 100644 index 00000000..5f973715 Binary files /dev/null and b/docs/openshift/virtualization/images/virtualization-perspective.png differ diff --git a/docs/openshift/virtualization/images/virtualmachines-list.png b/docs/openshift/virtualization/images/virtualmachines-list.png new file mode 100644 index 00000000..67fce342 Binary files /dev/null and b/docs/openshift/virtualization/images/virtualmachines-list.png differ diff --git a/docs/openshift/virtualization/images/vm-actions.png b/docs/openshift/virtualization/images/vm-actions.png new file mode 100644 index 00000000..bb083b4e Binary files /dev/null and b/docs/openshift/virtualization/images/vm-actions.png differ diff --git a/docs/openshift/virtualization/images/vm-console.png b/docs/openshift/virtualization/images/vm-console.png new file mode 100644 index 00000000..97e69f6c Binary files /dev/null and b/docs/openshift/virtualization/images/vm-console.png differ diff --git a/docs/openshift/virtualization/images/vm-disks.png b/docs/openshift/virtualization/images/vm-disks.png new file mode 100644 index 00000000..03b7232b Binary files /dev/null and b/docs/openshift/virtualization/images/vm-disks.png differ diff --git a/docs/openshift/virtualization/images/vm-from-instancetype.png b/docs/openshift/virtualization/images/vm-from-instancetype.png new file mode 100644 index 00000000..ef6dd674 Binary files /dev/null and b/docs/openshift/virtualization/images/vm-from-instancetype.png differ diff --git a/docs/openshift/virtualization/images/vm-network-default.png b/docs/openshift/virtualization/images/vm-network-default.png new file mode 100644 index 00000000..a8efbbbd Binary files /dev/null and b/docs/openshift/virtualization/images/vm-network-default.png differ diff --git a/docs/openshift/virtualization/images/vm-restored-running.png b/docs/openshift/virtualization/images/vm-restored-running.png new file mode 100644 index 00000000..a183e81a Binary files /dev/null and b/docs/openshift/virtualization/images/vm-restored-running.png differ diff --git a/docs/openshift/virtualization/images/vm-scripts-setup.png b/docs/openshift/virtualization/images/vm-scripts-setup.png new file mode 100644 index 00000000..9f4023e7 Binary files /dev/null and b/docs/openshift/virtualization/images/vm-scripts-setup.png differ diff --git a/docs/openshift/virtualization/images/vm-state-actions.png b/docs/openshift/virtualization/images/vm-state-actions.png new file mode 100644 index 00000000..b16f6e69 Binary files /dev/null and b/docs/openshift/virtualization/images/vm-state-actions.png differ diff --git a/docs/openshift/virtualization/images/vm-storage-disks.png b/docs/openshift/virtualization/images/vm-storage-disks.png new file mode 100644 index 00000000..316b7bbc Binary files /dev/null and b/docs/openshift/virtualization/images/vm-storage-disks.png differ diff --git a/docs/openshift/virtualization/images/windows-templates.png b/docs/openshift/virtualization/images/windows-templates.png new file mode 100644 index 00000000..b04fd46a Binary files /dev/null and b/docs/openshift/virtualization/images/windows-templates.png differ diff --git a/docs/openshift/virtualization/images/yaml-tab.png b/docs/openshift/virtualization/images/yaml-tab.png new file mode 100644 index 00000000..412eb80e Binary files /dev/null and b/docs/openshift/virtualization/images/yaml-tab.png differ diff --git a/docs/openshift/virtualization/intro-virtualization-on-openshift.md b/docs/openshift/virtualization/intro-virtualization-on-openshift.md new file mode 100644 index 00000000..2bc18193 --- /dev/null +++ b/docs/openshift/virtualization/intro-virtualization-on-openshift.md @@ -0,0 +1,116 @@ +# Introduction to Virtualization on OpenShift + +This will provide an in-depth overview of OpenShift Virtualization, highlighting +its benefits and key concepts. + +## Overview of OpenShift Virtualization + +Red Hat OpenShift Virtualization isn't entirely new - it's built on the upstream +open source project [KubeVirt](https://kubevirt.io/). It is an add-on to Red Hat +OpenShift that enables you to run virtualized workloads alongside your existing +containerized workloads on the same infrastructure. As a built-in feature of the +platform, OpenShift Virtualization offers a modern solution for organizations to +run and deploy both new and existing VM workloads efficiently. + +While [OpenShift](../get-started/openshift-overview.md) was originally envisioned +as a pure container and application development platform, it has since been +extended with additional APIs and technical enhancements in the CoreOS operating +system to support virtualization. + +OpenShift Virtualization is now a unified platform designed to seamlessly accommodate +both containers and VMs. This allows users to integrate VMs into containerized +workflows by running a VM within a container. You can manage VMs either exclusively +or alongside containerized workloads on the same platform. + +Users seeking to leverage the [Kubernetes-native benefits](#benefits-of-using-red-hat-openshift-virtualization) +of OpenShift Virtualization can modernize their infrastructure by migrating workloads +from traditional servers-based platforms, such as [NERC OpenStack](../../openstack/index.md), +to modern cloud-native NERC Red Hat OpenShift Virtualization. This transition +enables organizations to maintain compatibility with existing VM-based workloads +while benefiting from a unified platform that supports both containerized and VM +workloads. + +This approach enables organizations to benefit from faster time-to-market and +other advantages of these modern workflows - without needing to first redesign +virtualized workloads as container-native applications. + +## Benefits of Using Red Hat OpenShift Virtualization + +By moving VMs from other platforms to Red Hat OpenShift, you can maximize the +value of your existing virtualization investments while benefiting from cloud-native +architectures, streamlined operations and management, and modern development approaches. + +![Red Hat OpenShift Virtualization](images/openshift-virtualization.png) + +- **Unified Platform**: Run and manage both containerized applications and VM +workloads on a single Kubernetes-native platform. + +- **Operational Consistency**: Apply the same DevOps and GitOps practices across +VMs and containers using familiar OpenShift tools and workflows. + +- **Cost Efficiency**: Reduce infrastructure overhead by consolidating workloads +and eliminating the need for separate virtualization platforms. + +- **Seamless Migration**: Import, clone, and migrate existing VMs - including those +from legacy virtualization environments like VMware - into OpenShift with minimal +effort. + +- **Scalability & Automation**: Leverage Kubernetes-native scaling, scheduling, +and automation features for VM workloads, just like with containers. + +- **Enhanced Developer Experience**: Provide developers with self-service access +to VMs via OpenShift's UI, CLI, and APIs, integrated into their existing CI/CD +pipelines. + +- **Improved Security and Governance**: Benefit from OpenShift's built-in RBAC, +SELinux, and policy enforcement to secure both container and VM environments. + +- **Live Migration Support**: Migrate running VMs between nodes without downtime, +improving availability during maintenance or scaling operations. + +- **Integrated Monitoring & Logging**: Use OpenShift's observability tools (e.g., +Prometheus, Grafana, Loki) to monitor and troubleshoot both VMs and container workloads. + +- **Future-Ready Infrastructure**: Modernize applications incrementally by running +legacy VMs and cloud-native containers side by side, supporting gradual transitions. + +Looking for more information on the benefits of Red Hat OpenShift Virtualization? +[Read this eBook to learn more](https://www.redhat.com/en/engage/15-reasons-adopt-openshift-virtualization-ebook). + +## Key Concepts and Terminology + +OpenShift Virtualization extends our NERC OpenShift Container Platform (OCP) cluster +by introducing new objects through **Kubernetes custom resources**. These resources +enable users to perform a wide range of virtualization tasks, including: + +- Creating and managing Linux and Windows VMs + +- Running pod and VM workloads side by side in the same NERC OCP cluster + +- Connecting to VMs using various console and CLI tools + +- Importing and cloning existing VMs + +- Managing network interface controllers (NICs) and storage disks attached to VMs + +- Performing live migrations of VMs between nodes + +!!! info "Note" + + In OpenShift Virtualization, VMs are native Kubernetes objects that you can + manage by using the OCP web console or the command line. OpenShift Virtualization + is represented by the ![OpenShift Virtualization icon](images/virt-icon.png){ width="25" } + icon. + +At a high level, the following diagram illustrates the components of Red Hat +OpenShift Virtualization in comparison to Red Hat Virtualization and Red Hat +OpenStack Platform: + +![Containerizing KVM](images/containerizing-kvm.png) + +To learn more about Red Hat OpenShift Virtualization, please refer to the +[Red Hat OpenShift Virtualization FAQ](https://www.redhat.com/en/resources/openshift-virtualization-faq), +the [Red Hat OpenShift Virtualization documentation page](https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/virtualization/index), +and the [Red Hat OpenShift Virtualization product page](https://www.redhat.com/en/technologies/cloud-computing/openshift/virtualization). + +--- diff --git a/docs/openshift/virtualization/running-and-managing-vms.md b/docs/openshift/virtualization/running-and-managing-vms.md new file mode 100644 index 00000000..2df26939 --- /dev/null +++ b/docs/openshift/virtualization/running-and-managing-vms.md @@ -0,0 +1,831 @@ +# Running and Managing Virtual Machines (VMs) + +## Creating and Launching VMs + +OpenShift Virtualization provides multiple ways to create and launch virtual +machines (VMs) easily. Depending on your workload requirements, you can either +create VMs from predefined **instance types** or use customizable **templates** +for rapid deployment. + +### Creating virtual machines from instance types + +An instance type is a reusable object where you can define resources and characteristics +to apply to new VMs. Instance types offer a fast and standardized way to create +VMs by specifying predefined compute, memory, and disk resource settings. This +approach is ideal when you need to quickly provision VMs with consistent configurations +across your environment. + +!!! note "Important Note" + + When you create a VM from an instance type, you cannot override any parameters + defined in the instance type. + + Because instance types require defined CPU and memory attributes, OpenShift + Virtualization always rejects additional requests for these resources when + creating a VM from an instance type. + +You can create a VM from an instance type by using the OpenShift Container Platform +web console. Additionally, you can create a VM by copying an existing snapshot or +cloning an existing VM. + +You also have the option to create a VM from a list of available bootable volumes. +Both Linux-based and Windows-based volumes can be added to the bootable volumes +list for VM creation. + +#### Steps to create a VM from an instance type by using the web console + +1. In the left navigation pane, navigate to the **Virtualization** -> **Catalog** +section in the OpenShift Web Console. + + Alternatively, in the left navigation pane, click **Virtualization** -> **VirtualMachines**. + From the **Create VirtualMachine** dropdown choose **From InstanceType** as shown + below: + + ![VM From InstanceType](images/vm-from-instancetype.png) + + The **InstanceTypes** tab opens by default as shown below: + + ![InstanceTypes Dashboard](images/catalog-instancetypes.png) + +2. Select either of the following options: + + - From the Volume table, select a bootable volume to boot your VirtualMachine. + If the list is truncated, click the **Show all** button to display the entire + list. + + !!! info "Optional" + + Click the **star** icon to designate a bootable volume as a favorite. + Starred bootable volumes appear first in the volume list. + + - Click **Add volume** to upload a new volume or to use an existing persistent + volume claim (PVC), a volume snapshot, or a *containerDisk* volume. Click **Save**. + + Logos of operating systems that are not available in the cluster are shown + at the bottom of the list. You can add a volume for the required operating + system by clicking the **Add volume** link. + + In addition, there is a link to the **Create a Windows boot source** quick + start. The same link appears in a popover if you hover the pointer over + the *question mark* icon next to the Select volume to boot from line as + shown below: + + ![Add Boot Volume](images/add-boot-volume.png) + + Immediately after you install the environment or when the environment is + disconnected, the list of volumes to boot from is empty. In that case, + three operating system logos are displayed: Linux, RHEL, and Windows as + shown below: + + ![Empty Volume List](images/empty-volume-list.png) + + You can add a new volume that meets your requirements by clicking the + **Add volume** button. + +3. Click an InstanceType tile and select the appropriate resource size (CPU, memory, +disk size) for your workload, as shown below: + + ![Create VM Seleting InstanceType](images/create-vm-instancetype.png) + +4. *Optional*: Click **View YAML & CLI** to view the YAML file. Click CLI to view +the CLI commands. You can also download or copy either the YAML file contents or +the CLI commands. + +5. *Optional*: In **VirtualMachine details**, you can edit the VM's name, disk & +storage settings, and **Public SSH key**, etc. Configure any overrides the original +parameters for them if necessary. + + !!! info "Project-Level SSH Key Injection" + + You can add an SSH key to a project as [described here](getting-started.md#set-up-a-public-ssh-key). + This key will then be automatically injected into any VMs you create within + that project. + + !!! note "Mount a Windows drivers disk in a Windows VM" + + *Optional*: If you are creating a Windows VM, you can mount a Windows driver + disk: + + - Click the **Customize VirtualMachine** button. + + - On the **VirtualMachine details** page, click **Storage**. + + - Select the **Mount Windows drivers disk** checkbox. + +6. Review the configuration and then create the virtual machine by clicking +**Create VirtualMachine**. + +7. Navigate to **Virtualization** -> **VirtualMachines** in the left menu bar to +view the status of the newly provisioned virtual machine. To verify that you have +successfully created the virtual machine, make sure your VM is in **Running** status. + +#### Changing the instance type of a VM + +You can modify the instance type of a running VM using the web console, and the +change takes effect immediately. + +**Prerequisites**: + +You created the VM by using an instance type. + +**Procedure**: + +1. From the **VirtualMachine details** page, click the **Configuration** tab. + +2. On the **Details** tab, click the instance type text to open the **Edit Instancetype** +dialog. For example, click the pencil icon next to **1 CPU | 2 GiB Memory**. + +3. Edit the instance type by using the **Series** and **Size** lists. + + - Select an item from the **Series** list to show the relevant + sizes for that series. For example, select **General Purpose**. + + - Select the VM's new instance type from the **Size** list. For + example, select **medium: 1 CPUs, 4Gi Memory**, which is available + in the **General Purpose** series. + + ![Edit Instance Type](images/edit-instancetype.png) + +4. Click **Save**. + +**Verification**: + +1. Click the **YAML** tab. + +2. Click **Reload**. + +3. Review the VM YAML to confirm that the instance type changed. + +### Creating virtual machines from templates + +Templates provide a fast and simple way to provision VMs. OpenShift Virtualization +includes predefined templates for a wide range of common operating systems and +hardware configurations. Templates can include preset resource allocations, disk +images, cloud-init scripts, and networking options. For example, templates are +available for both Linux and Microsoft Windows VMs. Templates allow you to create +VMs based on reusable configurations, ideal for specific operating systems, +application stacks, or organizational standards. + +#### Provision a virtual machine using default templates + +1. In the left navigation pane, navigate to the **Virtualization** -> **Catalog** +section in the OpenShift Web Console. + + Alternatively, in the left navigation pane, click **Virtualization** -> **VirtualMachines**. + From the **Create VirtualMachine** dropdown choose **From template** as shown + below: + + ![VM From Template](images/from-template.png) + +2. On the *Catalog* screen, select the **Template catalog** tab, which contains +various templates (e.g., RHEL, Fedora, Windows Server) for creating virtual +machines (VMs). Use the available filters to narrow down the list of displayed +templates. Click on the template tile you want to use to create your VM. + + !!! tip "Template Catalog with Boot Source Available" + + Templates that display the label **Source available** are ready to use + immediately because they are backed by a pre-uploaded boot source image + stored in the `openshift-virtualization-os-images` project. This means you + can provision a VM directly from the template without needing to manually + upload an operating system ISO or configure a disk image. + + You can filter templates by "Boot source available" as shown below: + + ![Template Catalog with Boot Source Available](images/template-catalog-boot-source-available.png) + + **Benefits of Using Templates with Boot Sources:** + + - **Faster provisioning**: VMs can be launched instantly without waiting + for boot images to be uploaded. Since a boot source is already available, + the **Quick Create VirtualMachine** button is enabled, allowing you to + rapidly deploy a VM with minimal configuration. + + ![Source Available Template](images/source-available-template.png) + + - **Standardized configurations**: Ensures consistent VM settings across + environments. + + - **Simplified user experience**: Great for developers and teams who want + to get started without deep knowledge of underlying storage or image management. + +3. Verify that the **Template Info** is accurate for the virtual machine that you +want to create. + + ![Template Info](images/template-info.png) + +4. Enter the required parameters such as the VirtualMachine name, **Public SSH key**, +and optional customizations. Configure any overrides the original parameters for +storage, CPU | Memory, Optional parameters if necessary. + + !!! info "Project-Level SSH Key Injection" + + You can add an SSH key to a project as [described here](getting-started.md#set-up-a-public-ssh-key). + This key will then be automatically injected into any VMs you create within + that project. + +5. Create the virtual machine by clicking **Quick create VirtualMachine**. + +6. Navigate to **Virtualization** -> **VirtualMachines** in the left menu bar to +view the status of the newly provisioned virtual machine. To verify that you have +successfully created the virtual machine, make sure your VM is in **Running** status. + +#### Provision a virtual machine using customized templates + +1. In the left navigation pane, navigate to the **Virtualization** -> **Catalog** +section in the OpenShift Web Console. + +2. Click a template tile to view the virtual machine details. + + ![Customize Template](images/provision_with_custom_template.png) + +3. Expand the **Storage** and **Optional parameters** sections to modify related +virtual machine settings, then click **Next** at the bottom of the frame. + + ![Customize Parameters](images/customize_parameters.png) + +4. Click **Customize VirtualMachine** to edit the virtual machine settings. + +5. Customize virtual machine settings in the **Overview**, **YAML**, **Scheduling**, +**Environment**, **Network interfaces**, **Disks**, **Scripts**, and **Metadata** +tabs and click **Create VirtualMachine**. + + It includes the following tabs that allow you to view and edit VM settings: + + - **Overview**: Review the **Overview** tab with the default configuration + for the VM that displays general information it. + + For example, you can customize the number of processor cores and amount + of memory, change connected networks, add additional disks, and include + configuration scripts. + + ![Customized Template Example](images/custom-template-example.png) + + - **YAML**: The **YAML** tab provides direct access to the VM's Kubernetes + resource definition. This view is ideal for advanced users who want to make + low-level or bulk configuration changes not exposed in the UI. + + - **Scheduling**: The **Scheduling** tab allows you to control where and how + the VM runs within the cluster. Here, you can configure node selectors, + tolerations, affinity rules, eviction strategies, and dedicated + resource options (e.g., pinning CPUs or assigning PCI devices). + + ![Scheduling Tab](images/customize-scheduling-tab.png) + + - **Node Selector**: A **node selector** is used to specify one or more + cluster nodes that the VM is allowed to run on. Selection can be based + on node **name**, **label**, or **annotation**. + + - **Tolerations**: **Tolerations rules** allow VMs to be scheduled on + nodes that have **taints** applied. Taints act as restrictions—only + workloads with matching tolerations can be scheduled on those nodes. + This is useful in scenarios where certain nodes are dedicated for + specialized workloads, such as GPU-enabled VMs. + + - **Affinity Rules**: **Affinity rules** specify that a VM should be co-located + with certain workloads, while **anti-affinity rules** ensure that the + VM is scheduled away from specific workloads. These rules are useful + for high availability, workload isolation, or optimizing resource usage. + + - **Dedicated Resources**: The **dedicated resources** option allows you + to assign specific physical resources to a VM. This includes allocating + individual CPU cores or passing through PCIe devices like GPUs or network + cards directly to the VM. + + - **Eviction Strategy**: By default, VMs use the **Live Migrate** eviction + strategy. This enables seamless migration of VMs to another node when + a node is cordoned and drained for maintenance, such as applying updates. + You can alternatively configure the VM to: + + - Shut down and perform a cold migration + + - Remain on the current node without migrating + + - **Descheduler**: OpenShift includes a **descheduler** that periodically + evaluates VMs and their host nodes. It can trigger migration to another + node for reasons such as: + + - Resource optimization + + - Affinity or anti-affinity rule violations + + - **Network Interfaces**: Use the **Network Interfaces** tab to view and manage + the VM's network configuration. You can attach the VM to one or more networks + (such as Software Defined Network (SDN) or Multus), define IP address assignment + modes, and add or remove network interfaces as needed. By default a VM is + connected to the `Pod networking` network with a `masquerade` type (which + is just OpenShift internal networking that connects the VM to the SDN). + This enables outbound access from the VM and allowing other VMs and Pods + within the cluster to reach it. + + ![Network Interfaces Tab](images/customize-networking-interfaces-tab.png) + + - **Disks**: The **Disks** tab lists all virtual disks attached to the VM. + You can add new disks, resize existing ones, or configure boot priority. + If the guest agent is installed, it also displays filesystem details and + usage statistics. + + ![Disks Tab](images/customize-disks-tab.png) + + You can add new disks or modify the default ones before creating the VM. + Additionally, you can change the storage class, set a custom boot source + - such as an ISO - and specify a different disk interface instead of using + the default `virtio` interface. + + !!! info "Note" + + For more details about virtual machine storage, refer to [this page](storage.md). + + - **Scripts**: The **Scripts** tab is used to configure **cloud-init** for + Linux or **sysprep** for Windows VMs. This also includes **Authorized SSH + key** to setup user credentials. Here, you can set first-boot commands, + inject SSH keys, install packages, define users, and automate initial + system configuration. + + ![Scripts Tab](images/customize-scripts-tab.png) + + - **Cloud-init** can be configured either through the GUI dialog or by using + a standard YAML script for more advanced customization. + + ![Cloud Init Dialog](images/cloud-init-dialog.png) + + - An **Authorized SSH key** can optionally be provided to allow one or more + users to connect to the VM without a password. This SSH key can be stored + as a `Secret` and automatically applied to new Linux VMs if desired. + + - **Sysprep** is a Microsoft Windows tool used for automatically configuring + new OS deployments. It supports settings such as the hostname, default + `Administrator` password, and joining an Active Directory domain. Please + refer to [this document](windows-vm.md#how-to-configure-sysprep) for + instructions on how to set up or edit `Sysprep`. + + !!! tip "Tips" + + To learn more about customizing and deploying Windows virtual machines, + refer to [this page](windows-vm.md). + + - **Metadata**: The **Metadata** tab allows you to view and edit Kubernetes + metadata for the VM, such as labels and annotations. These are useful for + organizing, selecting, or applying policies to VMs across your environment. + + !!! info "Very Important" + + When creating a VM, make sure the **Start this VirtualMachine after + creation** option is checked. If you forget to enable this option and + the VM is created in the *Stopped* state, you can start it manually + by clicking the **Actions** drop-down in the upper-right corner of the + panel and selecting **Start**. + + ![Start this VirtualMachine after creation](images/ensure-start-vm-after-creation.png) + +6. Navigate to **Virtualization** -> **VirtualMachines** in the left menu bar to +view the status of the newly provisioned virtual machine. + +#### Creating a custom VM template in the web console + +You can create a VM template by editing a YAML file in the OpenShift Container +Platform web console. + +**Procedure**: + +- In the web console, click **Virtualization** -> **Templates** in the side menu. + +- Click **Create Template**. + +- Specify the template parameters by editing the **YAML** file. + +- Click **Create**. + +The template is displayed on the **Templates** page. + +!!! tip "Tips" + + You can also create virtual machines by providing YAML manifests i.e. YAML or + JSON definitions, either through the web console or via the command line. + + ![Create VM With YAML](images/create-vm-with-yaml.png) + + You can also view amd update the existing VM's configuration using the **YAML** + tab on the **VirtualMachine Details** page, as [explained here](#yaml-tab). + +## Controlling virtual machine states + +You can stop, start, restart, pause, and unpause virtual machines from the web console. + +!!! tip "Note" + + You can use `virtctl` to manage VM states and perform various other actions + directly from the command line. For a full list of VM management commands, + refer to the official Red Hat documentation: [VM Management Commands](https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/virtualization/getting-started#vm-management-commands_virt-using-the-cli-tools). + +1. Navigate to **Virtualization** -> **VirtualMachines** in the left menu bar to +view the status of the newly provisioned virtual machine. + +2. Select the VM of your interest from the list. + +3. Press the top-right dropdown, **Actions**, to list the available options: + + ![VM State Actions](images/vm-state-actions.png) + + !!! tip "Shorthand Method using Actions Icon Bar" + + Alternatively, you can simply click the action icons - such as **Stop**, + **Restart**, **Pause**, and **Start** - located near to the **Actions** + menu as shown below: + + ![Actions Icon Bar](images/actions-icon-bar.png) + + - **Stop**: Initiates a graceful shutdown of the VM. + + - **Restart**: Sends a reboot signal to the operating system. Guest agent + integrations are required for this action to function properly. + + - **Pause**: Suspends the VM's execution by freezing its processes. The VM will + not consume CPU or I/O resources during this state, but its memory remains + allocated at the hypervisor level. + + !!! note "Note" + + While launching the VM, you selected the "Start this VirtualMachine after + creation" checkbox (which is selected by default). As a result, the VM is + already in *Running* status, which is why the **Start** option is not available. + +4. Press **Stop** and wait till the Virtual Machine is in state *Stopped*. + + ![Stopped VM](images/stopped-vm.png) + +5. Clicking on **Actions**, the option **Start** appears, and the options **Restart** +and **Pause** are greyed out as shown below: + + ![VM Actions List Stop](images/VM_Actions_List_Stopped.png) + +6. Press **Start**, and wait for the *Running* status. + +7. Using the **Actions** menu, press the **Pause** option. The Virtual Machine +state will change to *Paused*. + + ![Paused VM](images/paused-vm.png) + +8. Once your VM is in the *Paused* state, unpause the Virtual Machine using **Actions** + and the option **Unpause**. + +## VirtualMachine details page + +Follow these steps to view details of any virtual machine using the web console: + +1. In the left navigation pane, navigate to the **Virtualization** -> **Catalog** +section in the OpenShift Web Console. + +2. Select any one of the virtual machine to view the **VirtualMachine details** +page of that selected VM. + +### Overview Tab + +Click the **Overview** tab to view details including its status, creation time, +operating system, and resource usage such as CPU, memory, storage, and network transfer. +This tab also displays the VM's IP address on the SDN, along with additional details +such as the boot order, workload profile, and the cluster node and pod currently +hosting the VM. + +![Overview Tab](images/overview-tab.png) + +- Hostname + +- Operating system version and timezone information + +- Active users + +- Utilization: CPU, Memory, Storage and Network. + +### Metrics Tab + +Navigate to the **Metrics** tab to access detailed usage information, including +the ability to specify a custom time range. + +![Metrics Tab](images/metrics-tab.png) + +### YAML Tab + +Navigate to the **YAML** tab to access the VM's full Kubernetes resource definition, +ideal for making low-level or bulk configuration changes not available through the +web console. The `VirtualMachine` resource manages virtual machines that are not +currently running or are in a stopped state. It contains the template used to create +a `VirtualMachineInstance` (VMI) and reflects the running state of the VMI in its +status. + +![YAML Tab](images/yaml-tab.png) + +### Configuration Tab + +The **Configuration** tab provides access to editable VM properties such as +scheduling policies, environment variables, network interfaces, disks, and `cloud-init` +or `sysprep` scripts. It enables you to fine-tune VM behavior before or after deployment. + +For more details on how to update VM configurations, see +[Updating Virtual Machine Configurations](#update-virtual-machine-configurations). + +### Events Tab + +After the VM is created, navigate to the **Events** tab to review details of the +creation process. This displays a chronological list of system-generated events +related to the VM lifecycle, such as creation, start, stop, migration, or failure +notifications. Any issues encountered during VM creation will also be displayed +in this tab. This is helpful for debugging and auditing VM behavior. + +![Events Tab](images/events-tab.png) + +### Console Tab + +Navigate to the **Console** tab to access the VM's graphical or serial console. +This enables direct interaction with the guest operating system as if you were +physically accessing the machine. + +For more details on how to access the VM via console, see +[Access the Virtual Machine Console](#access-the-virtual-machine-console). + +### Snapshots Tab + +The **Snapshots** tab allows you to create, manage, and restore snapshots of +the VM. Snapshots capture the VM's state and data at a specific point in time and +can be used for backups, rollbacks, or cloning. + +For more details on using snapshots to backup and restore a VM, see +[Backup and Restore by Using VM Snapshots](storage.md#backup-and-restore-by-using-vm-snapshots). + +### Diagnostics Tab + +The **Diagnostics** tab provides troubleshooting information and health indicators +for the VM. It includes alerts, conditions, and additional metadata that help you +investigate operational or performance issues. + +!!! info "Editing VM Metadata" + + After the VM is created, you can view and edit Kubernetes metadata for the VM, such as labels and annotations by clicking the **Actions** drop-down in the upper-right corner of the panel and selecting either **Edit labels** or **Edit annotations** options as shown below: + + ![Edit Metadata](images/edit-labels-and-annotations.png) + +## Update virtual machine configurations + +As workload demands change, you may need to update the configurations of running +virtual machines. You can change a selection of **configuration** options using +the OpenShift Virtualization web console. + +Follow these steps to reconfigure existing virtual machines in the web console: + +1. In the left navigation pane, navigate to the **Virtualization** -> **Catalog** +section in the OpenShift Web Console. + +2. Select a virtual machine to view the **VirtualMachine details** page. + + ![VM List](images/virtualmachines-list.png) + +3. Click the **Configuration** tab. + + ![Update VM Configuration](images/update-vm-configs.png) + + It includes seven subtabs that allow you to view and edit VM settings: Details, + Storage, Network, Scheduling, SSH, Initial run, and Metadata. + + - **Details**: + Here you can change the VirtualMachine details such as InstanceType, Hostname, + Hardware devices, etc. + + - **Storage**: + Here you can change **Disks** and **Environment** attached to the VM. + + - **Disks**: Lists the disks currently attached to the VM and allows you + to add new ones. If the guest agent is installed, this section also displays + filesystem details and usage statistics. + + - **Environment**: You can attach ConfigMaps, Secrets, and Service Accounts + as additional disks. This is useful for passing configuration data to applications + running inside the VM. + + - **Network**: + Displays the current network interfaces configured for the VM and provides + the option to add new ones. + + - **Scheduling**: + This section includes advanced configuration options that determine where + the VM should run and the strategy to follow for eviction. It allows you + to configure affinity and anti-affinity rules, node selectors, tolerations, + and other settings that influence how and where the VM is scheduled within + the cluster. + + - **SSH**: + Allows you to set the SSH settings such as injecting SSH keys for the VM. + + - **Initial run**: + This tab allows you to configure **cloud-init** for Linux or **sysprep** + for Microsoft Windows. You can specify commands to be executed at first + boot, such as user credentials, installing applications, setting up network + configuration, and more. + + - **Metadata**: + This allows you to view and edit Kubernetes metadata for the VM, such as + labels and annotations. + +4. List the disks associated with the VM by clicking **Storage** subtab: + + ![VM Disks](images/vm-disks.png) + + Here you can view the Name, Size, PVC source, Interface, and Storage class - + which defines the source and type of storage attached to the VM as the VM disks. + + !!! info "Note" + + For more details about modifying storage for an existing VM, refer to [this page](storage.md#modifying-storage-for-an-existing-vm). + +5. Examine the network interfaces attached to the VM by clicking on the **Network** +subtab: + + ![Default VM Network](images/vm-network-default.png) + + When a VM is created, an interface using the `Pod Networking` network with a + `masquerade` type is created by default. This connects the VM to the OpenShift + SDN, enabling outbound access from the VM and allowing other VMs and Pods within + the cluster to reach it. + +!!! note "Important Note" + + Some changes require a restart of the VM. The web console notifies you if a + restart is needed. + +## Access the virtual machine console + +Click the **Console** tab to access the VM's console as shown below: + +![Console Tab](images/vm-console.png) + +You can connect to the following consoles to connect to VM consoles: + +- [VNC console](#connecting-to-the-vnc-console) + +- [Serial console](#connecting-to-the-serial-console) + +- [Desktop viewer for Windows VMs (Only)](#connecting-to-the-desktop-viewer) + +### Connecting to the VNC console + +You can connect to the VNC console of a VM using either the OpenShift Container +Platform web console or the `virtctl` command-line tool. + +#### Connecting to the VNC console by using the web console + +You can connect to the VNC console of a VM using the OpenShift Container Platform +web console. + +!!! note "Note" + + When connected to a Windows VM with a vGPU assigned as a mediated device, you + can switch between the default display and the vGPU display. + +**Procedure**: + +1. On the **Virtualization** -> **VirtualMachines** page, click a VM to open the +**VirtualMachine details** page. + +2. Click the **Console** tab. The VNC console session starts automatically. + + ![VNC Console Connect](images/console-vm-vnc-connect.png) + +3. *Optional*: To switch to the vGPU display of a Windows VM, select +**Ctl + Alt + 2** from the **Send key** list. + + - Select **Ctl + Alt + 1** from the **Send key** list to restore the default + display. + +4. Click **Guest login credentials** to view the password generated for the default +username, based on the selected operating system (OS) for the VM. This option is +available only when the VM has been customized - by default in this template - using +OpenShift Virtualization with `cloud-init` to set the password. + + ![Guest Login Credentials](images/guest-login-vnc-console.png) + + !!! tip "Important Tips" + + You can click on **Paste** to paste the password after copying it. + +5. After you log in, run the `ip a` command to display the interfaces and IP addresses: + + ![IP Interfaces](images/ip-interfaces.png) + + Since this network adapter is connected to the SDN, the assigned IP address + is an internal IP used by the KVM hypervisor and is not externally accessible. + This internal IP remains the same even if the VM is live migrated to a different + node, although the external IP associated with the SDN connection may change. + +6. Run `lsblk` to display the list of disks and their capacities and free space: + + ![Disk Spaces](images/lsblk-command.png) + + - `/dev/vda` is the primary disk created during VM creation, sized according + to the specifications provided at that time. + + - `/dev/vdb` is a temporary disk used by `cloud-init` to inject required data, + such as setting the password for the default OS user. This disk can be safely + removed after the VM has been created and initialized. + +7. You can verify the number of CPUs and the amount of memory allocated to the +VM - matching the flavor selected during creation - by using the following commands +inside the VM: + + - `nproc`: Displays the number of available CPU cores. + + - `free -m`: Shows the amount of memory in megabytes. + + ![CPU and RAM Memory](images/cpu-and-mem.png) + +8. To review the guest customization, mount the `cloud-init` disk by running the +following commands: + + sudo mount /dev/vdb /mnt + sudo cat /mnt/user-data; echo + + ![Cloud Init Data](images/cloud-init-user-data.png) + +9. To end the console session, click outside the console pane and then click **Disconnect**. + +### Connecting to the serial console + +You can connect to the serial console of a VM using either the OpenShift Container +Platform web console or the `virtctl` command-line tool. + +!!! note "Important Note" + + Concurrent VNC connections to a single VM are not currently supported. + +#### Connecting to the serial console by using the web console + +You can connect to the serial console of a VM using the OpenShift Container Platform +web console. + +!!! note "Note" + + When connected to a Windows VM with a vGPU assigned as a mediated device, you + can switch between the default display and the vGPU display. + +**Procedure**: + +1. On the **Virtualization** -> **VirtualMachines** page, click a VM to open the +**VirtualMachine details** page. + +2. Click the **Console** tab. The VNC console session starts automatically. + +3. Click **Disconnect** to end the VNC console session. Otherwise, the VNC console +session continues to run in the background. + +4. Select **Serial console** from the console list. + +5. *Optional*: To switch to the vGPU display of a Windows VM, select +**Ctl + Alt + 2** from the **Send key** list. + + - Select **Ctl + Alt + 1** from the **Send key** list to restore the default + display. + +6. To end the console session, click outside the console pane and then click **Disconnect**. + +### Connecting to the desktop viewer + +You can connect to a Windows VM using the desktop viewer and Remote Desktop Protocol +(RDP) through the OpenShift Container Platform web console. + +!!! note "Note" + + If you connect to a Windows VM with a vGPU assigned as a mediated device, you + can switch between the default display and the vGPU-enabled display. + +**Prerequisites**: + +- You installed the QEMU guest agent on the Windows VM. + +- You have an RDP client installed. + +**Procedure**: + +1. On the **Virtualization** -> **VirtualMachines** page, click a VM to open the +**VirtualMachine details** page. + +2. Click the **Console** tab. The VNC console session starts automatically. + +3. Click **Disconnect** to end the VNC console session. Otherwise, the VNC console +session continues to run in the background. + +4. Select **Desktop viewer** from the console list. + +5. Click **Create RDP Service** to open the RDP Service dialog. + +6. Select **Expose RDP Service** and click **Save** to create a node port service. + +7. Click **Launch Remote Desktop** to download an `.rdp` file and launch the desktop +viewer. + +8. *Optional*: To switch to the vGPU display of a Windows VM, select +**Ctl + Alt + 2** from the **Send key** list. + + - Select **Ctl + Alt + 1** from the **Send key** list to restore the default + display. + +9. To end the console session, click outside the console pane and then click **Disconnect**. + +--- diff --git a/docs/openshift/virtualization/storage.md b/docs/openshift/virtualization/storage.md new file mode 100644 index 00000000..7d7658a3 --- /dev/null +++ b/docs/openshift/virtualization/storage.md @@ -0,0 +1,416 @@ +# Storage Management + +OpenShift Virtualization leverages Kubernetes objects - such as storage classes, +persistent volume claims (PVCs), and persistent volumes (PVs) - to manage storage +for VMs. PVCs are requests for storage resources with specific Storage classes, +capacities, and access modes. Through the Container Storage Interface (CSI), storage +systems receive these requests, allocate storage as PVs, and bind the PVs to the +corresponding PVCs. + +![Red Hat OpenShift Virtualization Storage Stack](images/rh-openshift-virt-storage-stack.png) + +Our cluster is already configured with default `StorageClass` objects that include +details such as quality-of-service levels, backup policies, and organization-specific +requirements. Storage classes define and categorize available storage resources. +This allows users to request storage resources by referencing the `StorageClass` +name, without needing in-depth knowledge of the underlying storage infrastructure. + +Navigate to **Virtualization** -> **Storage** -> **StorageClasses** from the +left-hand menu to view all available StorageClasses. + +![Available StorageClasses](images/available-storageclasses.png) + +## Create PersistentVolumeClaims (PVC) using the web console + +Follow these steps to create a PVC using the web console: + +**Procedure**: + +1. On the **Virtualization** -> **Storage** page, click the **PersistentVolumeClaims** +page. + +2. From the Project dropdown at the top left of the page, make sure you have selected +your own namespace that you want to work with. + +3. Click **Create PersistentVolumeClaim** and select the **With Data upload form** +option. + + ![Create PVC With Form](images/create-pvc-with-form.png) + +4. On the **Create PersistentVolumeClaim** screen, customize the PVC settings and +click **Create** to provision the PVC. + + ![Create PVC Screen](images/create-pvc-form.png) + +**Verification**: + +To verify that you have successfully created the PVC: + +Navigate to **Storage** -> **PersistentVolumeClaims** in the left menu bar to +view the status of all PVCs and their associated bound PVs. + +## Upload a boot source + +Boot sources are standardized OS images used to create VMs. + +Once a boot source is uploaded, it becomes available for creating VMs from templates. +Other users in the cluster can also use this boot source to provision VMs using +templates that reference it. + +To upload a boot source image, follow these steps: + +- Upload the boot source image using a PVC. + +This ensures that the image is stored persistently and can be reused across multiple +VM deployments. + +**Procedure**: + +1. On the **Virtualization** -> **Storage** page, click the **PersistentVolumeClaims** +page. + +2. From the Project dropdown at the top left of the page, make sure you have selected +your own namespace that you want to work with. + +3. Click **Create PersistentVolumeClaim** and select the **With Data upload form** +option. + + ![Create PVC With Data upload form](images/create-pvc-with-data-upload-form.png) + +4. On the **Upload data to Persistent Volume Claim** screen, click **Upload** in +the **Upload data** field to select the boot source image that you want to upload. + + ![Upload Data to PVC Form](images/upload-data-to-pvc-form.png) + +5. In the **Persistent Volume Claim Name** field, specify a name for the PVC. + +6. The **StorageClass** specifies the underlying storage type backing the VM disk. +This varies by storage provider, and a single provider may offer multiple storage +classes to represent different capabilities such as performance tiers or access +modes. + +7. In the **Size** field, specify the size of the PVC. + + !!! warning "Important Note" + + Ensure that the storage allocation you specify for the PVC is larger than + the size of the uncompressed image (i.e. the QCOW2 or ISO image) and any + other space requirements. Use the console to verify the size of the image + you want to upload. + +8. **Apply optimized StorageProfile Settings** use recommended clone strategies +and volume modes based on the selected storage type. + +9. Click **Upload**. Uploading the image may take some time, depending on the size +of the image. + +**Verification**: + +To verify that you have successfully uploaded your boot source: + +Click **Storage** -> **PersistentVolumeClaims**. + +In the boot source's project, your upload is listed. + +## OpenShift Virtualization Default Boot Sources + +Persistent virtual machines require persistent storage. During the installation +of the OpenShift Virtualization Operator, some PersistentVolumeClaims were automatically +created to hold template disks for various Linux distributions. + +Using these OS images is optional, and their creation and download can be disabled +through the appropriate setting in the Operator. However, they offer a quick and +convenient way to start provisioning VMs with OpenShift Virtualization, as they +use cloud images tailored for each supported distribution. These images typically +include `cloud-init` and have a minimal OS footprint optimized for virtualization. +Additionally, Red Hat-provided boot images are automatically updated when new +templates are released. + +The `openshift-virtualization-os-images` project contains all available boot +sources and is automatically enabled when OpenShift Virtualization is installed. + +In this section, we will review the PVCs created by the Operator, as well as the +PVCs associated with a virtual machine. + +**Procedure**: + +1. On the **Virtualization** -> **Storage** page, click the **PersistentVolumeClaims** +page. + +2. In the project drop-down menu, enable **Show default projects**, then select +the **openshift-virtualization-os-images** project as shown below: + + ![Select Project](images/select_project.png) + +3. List the boot sources that OpenShift Virtualization automatically created. Each +PVC represents a boot source image for a supported operating system distribution. + + ![Bootable OS PVCs](images/bootable-os-pvcs.png) + + !!! note "Note" + + Navigate to **Virtualization** -> **Bootable volumes** to obtain a list + of the available volumes. + +4. Select one of the available boot source PVCs - such as `fedora-XX` - to view its +detailed configuration. + + ![Fedora PVC](images/fedora-pvc.png) + + As you can see, `ocs-external-storagecluster-ceph-rbd` storage class is used. + The details reveal that the PVC is configured as `ReadWriteMany` (RWX), which + is required for features like live migration, and is using **Block** volume + mode. Note that the access mode (RWX) is critical, but the volume mode - block + or file - may vary by storage provider. Either mode will work as long as RWX + is supported. + + The PVC's capacity must be sufficient to store the base OS and any software + packages installed for use by VMs created from this template. While VMs cloned + from this disk can increase the size of their attached disk, they cannot reduce + it. The PVC will be created using a **DataVolume** through Containerized Data + Importer (CDI). A DataVolume is created. DataVolumes are used to manage the + creation of a VM disk, abstracting the clone or import process onto OpenShift + native storage during the virtual machine's creation flow. + + ![Storage Management](images/storage-managment.png) + +5. When a VM is created, the boot source image is cloned, and a new disk (PVC) +is provisioned for the VM. Switch to your project namespace and review the list +of PVCs. You will see a separate PVC for each disk associated with the VMs in +your project. + +6. A PVC requests storage from a specific `StorageClass`, or defaults to the +cluster's default class if none is specified. To view the associated PVs, navigate +to **Storage** -> **PersistentVolumes** in the OpenShift web console. From there, +you can sort the list by the **Claim** column to see which PVs are bound to which +PVCs. + +## Modifying Storage for an Existing VM + +Follow these steps to reconfigure existing virtual machines in the web console. + +1. In the left navigation pane, navigate to the **Virtualization** -> **Catalog** +section in the OpenShift Web Console. + +2. Select a virtual machine to view the **VirtualMachine details** page. + + ![VM List](images/virtualmachines-list.png) + +3. Click the **Configuration** tab. + + ![Update VM Configuration](images/update-vm-configs.png) + +4. List the disks associated with the VM by clicking **Storage** subtab: + + ![VM Disks](images/vm-storage-disks.png) + +5. Here you can perform any of the following tasks: + + - You can add a new disk (by clickling **Add Disk**). + + ![Add Disk](images/add-disk.png) + + - Edit existing disks (click the pencil icon next to the disk). + + ![Edit Disk](images/edit-disk.png) + + - Detach or delete unused disks. + +!!! note "Important Note" + + If the VM is running, some changes (e.g., disk size) may require you to stop + the VM before editing. + +## Cloning a VM by using the web console + +You can clone an existing VM by using the web console. + +**Procedure**: + +- Navigate to **Virtualization** -> **VirtualMachines** in the left menu bar. + +- Select a VM to open the **VirtualMachine details** page. + +- Click **Actions**. + +- Select **Clone**. + +- On the **Clone VirtualMachine** page, enter the name of the new VM. + +- *Optional*: Select the **Start cloned VM** checkbox to start the cloned VM. + + ![Clone VM Dialog](images/clone-vm-dialog.png) + +- Click **Clone**. + +- A new VM is created, the disks are cloned and automatically the portal will +redirect you to the new VM. + +!!! note "Note" + + Note that if the VM is powered on, it will be stopped in order to perform the + clone. However, if a snapshot of the VM exists, you can create a clone from + the snapshot without powering off the VM. + +## Backup and restore by using VM snapshots + +Snapshots capture the state and data of a VM at a specific point in time. If you +encounter issues while configuring or updating your infrastructure, you can use +snapshots to restore the VM to a known good state. You can use a snapshot to restore +an existing VM to a previous state for backup, disaster recovery, or to quickly +roll back to an earlier development version. In the event of a security incident, +snapshots also allow you to preserve the VM's state for further investigation. + +!!! note "Note" + + A VM snapshot is created from a VM that is powered off (*Stopped* state) or + powered on (*Running* state). For running VMs, it ensures all data is written + to disk before capturing the snapshot. The platform leverages backing storage + mechanisms to efficiently snapshot VM data. + +OpenShift Virtualization includes features that simplify snapshot management across +your environment. You can: + +- Create new snapshots + +- Create VMs from existing snapshots + +- List all snapshots attached to a specific VM + +- Restore VMs from snapshots + +- Delete existing snapshots + +### Create and manage snapshots + +You can create snapshots of VMs using either the OpenShift Container Platform web +console or the command line. + +#### Creating a snapshot by using the web console + +**Prerequisites**: + +The VM snapshot includes disks that meet the following requirements: + +- The disks are data volumes or persistent volume claims. + +- The disks belong to a storage class that supports Container Storage Interface + (CSI) volume snapshots. + +- The disks are bound to a persistent volume (PV) and populated with a datasource. + +**Procedure**: + +1. Navigate to **Virtualization** -> **VirtualMachines** in the web console. + +2. Select a VM to open the **VirtualMachine details** page. + +3. Click the **Snapshots** tab and then click **Take Snapshot**. + + ![Take Snapshot of a VM](images/take-snapshot-of-vm.png) + + !!! tip "Take Snapshot using VM Action Option" + + You can take snapshot of a VM from the **VirtualMachine details** page + using **Actions** and the **Take snapshot** option. + + ![Take Snapshot using VM Action](images/take-snapshot-vm-action.png) + +4. Enter the snapshot name. + +5. Expand **Disks included in this Snapshot** to see the storage volumes to be + included in the snapshot. + +6. If your VM has disks that cannot be included in the snapshot and you wish to + proceed, select **I am aware of this warning and wish to proceed**. + + ![Save Snapshot of a VM](images/save-snapshot.png) + +7. Click **Save** and wait till the Snapshot has been created and the status shows +as *Operation complete*. + + ![Snapshot Operation Complete](images/snapshot-operation-complete.png) + +### Creating a VM from an existing snapshot by using the web console + +You can create a new VM by copying an existing snapshot. + +**Procedure**: + +1. Navigate to **Virtualization** -> **VirtualMachines** in the web console. + +2. Select a VM to open the **VirtualMachine details** page. + +3. Click the **Snapshots** tab. + +4. Click the Options menu for the snapshot you want to copy as shown below: + + ![Create VM Actions](images/create-snapshot-actions.png) + +5. Select **Create VirtualMachine**. + + ![Create VM Popup](images/create-vm-popup.png) + +6. Enter the name of the VM. + +7. *Optional*: Select the **Start this VirtualMachine after creation** checkbox + to start the new VM. + +8. Click **Create**. + +### Restoring virtual machines from snapshots + +You can restore VMs from snapshots using either the OpenShift Container Platform +web console or the command line. + +**Procedure**: + +1. Navigate to **Virtualization** -> **VirtualMachines** in the web console. + +2. Select a VM to open the **VirtualMachine details** page. + +3. If the VM is running, click the **Actions** menu and select **Stop**. + + ![VM Actions](images/vm-actions.png) + + !!! tip "Shorthand Method using Actions Icon Bar" + + Alternatively, you can simply click the action icons - such as **Stop**, + **Restart**, **Pause**, and **Start** - located near to the **Actions** + menu as shown below: + + ![Actions Icon Bar](images/actions-icon-bar.png) + +4. Select the **Snapshots** tab to view a list of snapshots for this VM. + +5. Click the Options menu for the desired snapshot, then click + **Restore VirtualMachine from snapshot** in the pop-up menu. + + ![Restore Snapshot Actions](images/restore-snapshot-actions.png) + + !!! note "Important Note" + + If the **Restore** option is greyed out please check if the VM is currently + *Running* state. You need to Stop the VM in order to enable restoring using + the snapshot. + + ![Restore VM from Snapshot Not Available](images/restore-snapshot-not-available.png) + +6. In the dialog shown, press **Restore**. + + ![Restore Snapshot Dialog](images/restore-snapshot-dialog.png) + +7. Select the **Snapshots** tab to view the snapshot status. + + ![Restored Snapshot](images/restored-vm-from-snapshot.png) + +8. Wait for the VM to finish restoring. Then, restart the VM by clicking the **Actions** +menu and selecting **Start**. + + ![Start VM](images/start-vm.png) + +9. Verify that the VM is booting correctly again. + + ![Running Restored VM](images/vm-restored-running.png) + +--- diff --git a/docs/openshift/virtualization/windows-vm.md b/docs/openshift/virtualization/windows-vm.md new file mode 100644 index 00000000..b0670f30 --- /dev/null +++ b/docs/openshift/virtualization/windows-vm.md @@ -0,0 +1,235 @@ +# Windows Virtual Machines with OpenShift Virtualization + +## Creating a Microsoft Windows virtual machine + +1. In the left navigation pane, navigate to the **Virtualization** -> **Catalog** +section in the OpenShift Web Console. + + Alternatively, in the left navigation pane, click **Virtualization** -> **VirtualMachines**. + From the **Create VirtualMachine** dropdown choose **From template** as shown + below: + + ![VM From Template](images/from-template.png) + +2. On the *Catalog* screen, select the **Template catalog** tab, which contains +various templates (e.g., RHEL, Fedora, Windows Server) for creating virtual +machines (VMs). + + !!! info "Important Note" + + Be sure to click the **Template project** dropdown in the upper-left corner + and select **All Projects**. Also, ensure the *All templates* option is + selected. This will display all available boot sources, including templates + for Microsoft Windows operating systems. + + To narrow the view, apply the **Operating System** filter and select **Windows**, + as shown below: + + ![Windows Templates](images/windows-templates.png) + +3. Select any one of the "Microsoft Windows OS" based template options. + + !!! info "Important Note" + + This type of machine does not have a **Quick Create VirtualMachine** option + as they don't have a boot source available. So once clicked they need to + be customized by clicking **Customize VirtualMachine** button. + +4. Click **Customize VirtualMachine** to proceed to the customize template options. + +5. Under Disk source, click the dropdown and select the Upload option. + +6. You may browse your local system for the desired Windows disk image. Once +selected, the upload process will begin and take several minutes. + +7. After the upload is complete, you can create the virtual machine and watch +it provisioning in the refreshed screen. + +8. Once this posts, click Open web console to open a new tab accessing the VM. + +9. Proceed with steps to change the Windows machine *Administrator* password. Once +done, the VM will be running. + +## How to Configure Sysprep + +**Sysprep** is a Microsoft Windows tool used for automatically configuring new +OS deployments. It supports settings such as the hostname, default `Administrator` +password, and joining an Active Directory domain. + +For a Windows volume, follow either of these set of steps to configure `sysprep` +options: + +- If you haven't already added Sysprep options for the Windows volume, follow + these steps while customizing the VM. Navigate to the **Scripts** tab to + configure the necessary settings. + + i. Click the edit icon beside **Sysprep** in the **VirtualMachine details** + section. + + ![VM Scripts setup](images/vm-scripts-setup.png) + + ii. Add the **Autoattend.xml** answer file on the opened dialog pop-up form: + + ![Sysprep Dialog Form](images/sysprep-dialog.png) + + !!! info "Sample Autoattend.xml answer file" + + This can be used as example for `Autoattend.xml` answer file: + + ```xml + + + + #pragma: allowlist secret + + + + + 1 + true + Primary + + + + + true + NTFS + + 1 + 1 + + + 0 + true + + + + + + + /IMAGE/NAME + Windows Server 2019 SERVERSTANDARD + + + + 0 + 1 + + + + + true + Administrator + My Organization + + false + + #pragma: allowlist secret + + en-US + + en-US + en-US + en-US + en-US + + + + #pragma: allowlist secret + false + + + + #pragma: allowlist secret + + + R3dh4t1! + true</PlainText> + </Password> + <Enabled>true</Enabled> + <LogonCount>999</LogonCount> + <Username>Administrator</Username> + </AutoLogon> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideLocalAccountScreen>true</HideLocalAccountScreen> + <HideOnlineAccountScreens>true</HideOnlineAccountScreens> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Work</NetworkLocation> + <ProtectYourPC>3</ProtectYourPC> + <SkipMachineOOBE>true</SkipMachineOOBE> + </OOBE> + <UserAccounts> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Description>Local Administrator Account</Description> + <DisplayName>Administrator</DisplayName> + <Group>Administrators</Group> + <Name>Administrator</Name> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <TimeZone>Eastern Standard Time</TimeZone> + </component> + </settings> + <settings pass="oobeSystem"> + <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">#pragma: allowlist secret + <InputLocale>en-US</InputLocale> + <SystemLocale>en-US</SystemLocale> + <UILanguage>en-US</UILanguage> + <UserLocale>en-US</UserLocale> + </component> + <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">#pragma: allowlist secret + <AutoLogon> + <Password> + <Value>R3dh4t1!</Value> + <PlainText>true</PlainText> + </Password> + <Enabled>true</Enabled> + <LogonCount>999</LogonCount> + <Username>Administrator</Username> + </AutoLogon> + <OOBE> + <HideEULAPage>true</HideEULAPage> + <HideLocalAccountScreen>true</HideLocalAccountScreen> + <HideOnlineAccountScreens>true</HideOnlineAccountScreens> + <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE> + <NetworkLocation>Work</NetworkLocation> + <ProtectYourPC>3</ProtectYourPC> + <SkipMachineOOBE>true</SkipMachineOOBE> + </OOBE> + <UserAccounts> + <LocalAccounts> + <LocalAccount wcm:action="add"> + <Description>Local Administrator Account</Description> + <DisplayName>Administrator</DisplayName> + <Group>Administrators</Group> + <Name>Administrator</Name> + </LocalAccount> + </LocalAccounts> + </UserAccounts> + <TimeZone>Eastern Standard Time</TimeZone> + </component> + </settings> + </unattend> + ``` + + After saving the content for Autoattend xml file it shows its availablity as + following: + + ![Autoattend Available](images/sysprep-autoattend-available.png) + + iii. Add the **Unattend.xml** answer file (if any). + + iv. Click **Save**. + +- If you want to use existing sysprep options for the Windows volume, follow + these steps: + + i. Click **Attach existing sysprep**. + + ii. Enter the name of the existing sysprep **Unattend.xml** answer file. + + iii. Click **Save**. + +--- diff --git a/mkdocs.yaml b/mkdocs.yaml index 3122954c..a1b9dec3 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -117,6 +117,12 @@ nav: - Rclone: openshift/storage/Rclone.md - Deleting Applications: - Deleting your applications: openshift/applications/deleting-applications.md + - Virtualization on OpenShift: + - Introduction: openshift/virtualization/intro-virtualization-on-openshift.md + - Getting Started: openshift/virtualization/getting-started.md + - Running and Managing VMs: openshift/virtualization/running-and-managing-vms.md + - Setting up Windows VM: openshift/virtualization/windows-vm.md + - Storage: openshift/virtualization/storage.md - Decommission OpenShift Resources: openshift/decommission/decommission-openshift-resources.md - Red Hat OpenShift AI (RHOAI): - NERC RHOAI: openshift-ai/index.md