diff --git a/docs/docs-content/automation/palette-cli/commands/commands.md b/docs/docs-content/automation/palette-cli/commands/commands.md index 2cda9fca54..87636be9cb 100644 --- a/docs/docs-content/automation/palette-cli/commands/commands.md +++ b/docs/docs-content/automation/palette-cli/commands/commands.md @@ -31,6 +31,8 @@ The following list contains all the supported Palette CLI subcommands. Click on - [`validator`](validator.md) - Deploy a kind cluster and install the Validator framework to validate your environment is ready for Palette. + +- [`vmo`](vmo.md) - Migrate, import and deploy VMs to Palette VMO. ## Global Flags @@ -58,3 +60,5 @@ Palette CLI supports the following global flags. - [Project](project.md) - [Validator](validator.md) + +- [VMO](vmo.md) diff --git a/docs/docs-content/automation/palette-cli/commands/vmo.md b/docs/docs-content/automation/palette-cli/commands/vmo.md index 1570b65571..efd40e5e51 100644 --- a/docs/docs-content/automation/palette-cli/commands/vmo.md +++ b/docs/docs-content/automation/palette-cli/commands/vmo.md @@ -34,7 +34,9 @@ The VMs can then be used with the Virtual Machine Orchestrator (VMO). ## Deploy OVA Use the `deploy-ova` subcommand to deploy an imported vSphere OVA to Palette VMO. The following flags are supported by -the `deploy-ova` subcommand. +the `deploy-ova` subcommand. Refer to the +[Import and Deploy OVAs to Palette VMO](../../../vm-management/create-manage-vm/advanced-topics/deploy-import-ova.md) +guide for further details on importing and deploying vSphere OVAs. | **Short Flag** | **Long Flag** | **Description** | **Type** | | -------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -------- | @@ -68,7 +70,9 @@ palette vmo deploy-ova --config-file ~/.palette/vmo/vms/my-ova-name/my-ova-name. Use the `import-ova` subcommand to import a vSphere OVA to Palette VMO. The following flags are supported by the `import-ova` subcommand. The OVA will be converted to the QCOW2 virtual disk storage format. This subcommand generates an OVA deployment configuration file. You can then either directly upload the imported image to a `DataVolume` or upload -it a Docker image registry. +it a Docker image registry. Refer to the +[Import and Deploy OVAs to Palette VMO](../../../vm-management/create-manage-vm/advanced-topics/deploy-import-ova.md) +guide for further details on importing and deploying vSphere OVAs | **Short Flag** | **Long Flag** | **Description** | **Type** | | -------------- | ---------------- | ----------------------------------------------------------------------------- | -------- | diff --git a/docs/docs-content/vm-management/create-manage-vm/advanced-topics/advanced-topics.md b/docs/docs-content/vm-management/create-manage-vm/advanced-topics/advanced-topics.md index 8a61e72bf6..dc58d956d5 100644 --- a/docs/docs-content/vm-management/create-manage-vm/advanced-topics/advanced-topics.md +++ b/docs/docs-content/vm-management/create-manage-vm/advanced-topics/advanced-topics.md @@ -22,3 +22,4 @@ by over-committing CPU and memory. - [Create DISK Templates](./create-disk-templates.md) - [Over-commit Resources to Enhance VM Performance](./vm-oversubscription.md) - [Migrate a VM to a VMO cluster](./migrate-vm-kubevirt.md) +- [Import and Deploy OVAs to Palette VMO](./deploy-import-ova.md) diff --git a/docs/docs-content/vm-management/create-manage-vm/advanced-topics/deploy-import-ova.md b/docs/docs-content/vm-management/create-manage-vm/advanced-topics/deploy-import-ova.md new file mode 100644 index 0000000000..4c1a5dd031 --- /dev/null +++ b/docs/docs-content/vm-management/create-manage-vm/advanced-topics/deploy-import-ova.md @@ -0,0 +1,334 @@ +--- +sidebar_label: "Import and Deploy OVAs to Palette VMO" +title: "Import and Deploy OVAs to Palette VMO" +description: "Learn how to import and deploy VMware vSphere OVAs to Palette VMO using the Palette CLI." +icon: " " +hide_table_of_contents: false +sidebar_position: 50 +tags: ["vmo", "palette-cli"] +--- + +VMware vSphere Virtual Machines (VMs) can be exported using the Open Virtual Appliance (OVA) format. This allows users +to share configurations and create templates for their VMs. These important templates need to be converted into +Kubernetes compatible formats before they can be used in a Kubernetes cluster. + +The [Palette CLI](../../../automation/palette-cli/palette-cli.md) provides the ability to import and deploy OVAs to +Palette VMO. + +## Limitations + +- Only OVAs whose operating systems are included under + [`virt-v2v` supported guest systems](https://libguestfs.org/virt-v2v-support.1.html) can be imported. + +## Prerequisites + +- A Healthy VMO cluster. Refer to the [Create a VMO Profile](../../create-vmo-profile.md) for further guidance. + + - Ensure that your VMO cluster has sufficient capacity for any VMs that you deploy. Refer to the + [Environment Setup](../../environment-setup.md) page for recommended environment sizes. + +
+ +:::warning + +If you need to provision `Block` storage volumes during the VM deployment process, add the following custom +configuration to your VMO cluster OS pack. Applying this configuration may cause a cluster repave. For more information, +refer to +[Repave Behaviors and Configurations](../../../clusters/cluster-management/node-pool.md#repave-behavior-and-configuration) + +Additionally, we recommend provisioning volumes with the `ReadWriteMany` access mode to ensure that VMs can be +[live migrated](https://kubevirt.io/user-guide/compute/live_migration/#limitations). + +```yaml +kubeadmconfig: + preKubeadmCommands: + # Start containerd with new configuration + - systemctl daemon-reload + - systemctl restart containerd + files: + - targetPath: /etc/containerd/config.toml + targetOwner: "root:root" + targetPermissions: "0644" + content: | + ## template: jinja + + # Use config version 2 to enable new configuration fields. + version = 2 + + imports = ["/etc/containerd/conf.d/*.toml"] + + [plugins] + [plugins."io.containerd.grpc.v1.cri"] + sandbox_image = "registry.k8s.io/pause:3.9" + device_ownership_from_security_context = true + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] + runtime_type = "io.containerd.runc.v2" + [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] + SystemdCgroup = true +``` + +If you are in a proxied environment, you must configure the CDI custom resource in order to deploy to a `DataVolume`. +Refer to the +[CDI Configuration](https://github.com/kubevirt/containerized-data-importer/blob/main/doc/cdi-config.md#options) +documentation. + +If you have configured Nginx together with MetalLB, add an entry to `/etc/hosts` that maps the CDI upload proxy host +name, for example `cdi-uploadproxy.mycompany.io`, to the Nginx load balancer’s public IP address. + +::: + +- Install kubectl command-line tool. Refer to the + [kubectl installation](https://kubernetes.io/docs/tasks/tools/install-kubectl/) guide to learn more. +- Install the virtctl command-line tool. Refer to the + [virtctl installation](https://kubevirt.io/user-guide/user_workloads/virtctl_client_tool/) guide for more information. + +## Enablement + +1. Download the [Kubeconfig](../../../clusters/cluster-management/kubeconfig.md) file of the VMO cluster. + +2. Open a terminal window and set the environment variable `KUBECONFIG` to point to the file you downloaded. + + ```shell + export KUBECONFIG= + ``` + +3. Execute the following command in your terminal. It creates a dedicated VM inside your VMO cluster which contains all + the tools required for OVA import and deployment. The VM is named `vmo-jh`. + + ```shell + cat <> /root/.ssh/authorized_keys + ``` + + :::info + + If you are starting an SSH session from a Windows machine, then you should omit the `--local-ssh=true` flag and + execute the command `virtctl ssh root@vmo-jh.default` only. + + ::: + +6. Copy your cluster's kubeconfig file to the VM. Replace the placeholders with local path to the kubeconfig file and + the path to your private key. The kubeconfig file is required for subsequent operations. + + ```shell + virtctl scp --identity-file root@vmo-jh.default:/root + ``` + +7. Download the newest [Palette CLI](../../../spectro-downloads.md#palette-cli) binary. Copy the binary to the VM, in + the same way you copied the kubeconfig file. Replace the placeholders with local path to the downloaded binary and + the path to your private key. + + ```shell + virtctl scp --identity-file root@vmo-jh.default:/root + ``` + +8. Start an SSH session with the VM. + + ```shell + virtctl ssh --identity-file root@vmo-jh.default --local-ssh=true + ``` + +9. Download an OVA file to import on the VM. Alternatively, you can upload the OVA file using `virtctl scp` as + demonstrated in previous steps. This guide uses a publicly available Bitnami image for demonstration purposes. + + ```shell + curl --location https://downloads.bitnami.com/files/stacks/wordpress/6.2.2/bitnami-wordpress-6.2.2-r1-debian-11-amd64.ova --output bitnami-wordpress-6.2.2-r1-debian-11-amd64.ova + ``` + +10. Set the environment variable `KUBECONFIG` to point to the file you uploaded. This allows your terminal session to + connect to your VMO cluster. + + ```shell + export KUBECONFIG= + ``` + +11. Execute the following command to start an interactive shell and begin the import process. + + ```shell + palette vmo import-ova + ``` + + :::tip + + You can save your configuration to a file, allowing you to revise your configuration and perform the import later. + + ```shell + palette vmo import-ova --config-only + ``` + + ::: + + The Palette CLI prompts you for information regarding the OVA you want to import. + + | **Parameter** | **Description** | **Values** | + | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | + | **OVA Path** | The path to the image your have uploaded to your VM. The path for the example provided is `/root/bitnami-wordpress-6.2.2-r1-debian-11-amd64.ova/`. | | + | **Container Disk Upload Method** | Indicate whether to upload the image directly to the target cluster as a `DataVolume` or build and push a Docker image. You will need to provide an existing image registry if you select Docker. | `DataVolume` / `Docker Image` | + | **Kubeconfig Path** | The path to the kubeconfig file you have uploaded to your VM. | | + | **DataVolume Namespace** | The namespace to create your `DataVolume`, if you selected this option previously. | | + | **DataVolume Name** | The name of your `DataVolume`. | | + | **Overhead Percentage for DataVolume Size** | Set an overhead percentage for your `DataVolume` compared to the OVA specification. This parameter is optional and can be skipped with the value `-1`. If skipped, the filesystem overhead percentage will be inferred from the CDI Custom Resource in your VMO cluster. Refer to the [CDI Configuration](https://github.com/kubevirt/containerized-data-importer/blob/main/doc/cdi-config.md#options) for further details. | | + | **Access Mode for the PVC** | Set the access mode for your `DataVolume`. Ensure that your configured CSI supports your selection. | `ReadWriteMany` / `ReadWriteOnce` | + | **Create a PVC with VolumeMode=Block** | Indicate whether to set `Block` volume mode on the `DataVolume`. | `y` / `N` | + | **StorageClass** | The storage class on the destination that will be used to create the VM volume. | | + | **CDI Upload Proxy URL** | Optionally, provide a URL to upload the CDI custom resource. If you have configured a CDI as part of your environment, specify `https://cdi-uploadproxy.mycompany.io`. Refer to the [Prerequisites](#prerequisites) section for configuration details. | | + +12. The import may take a few minutes to complete. The Palette CLI outputs the path for your OVA configuration file. + Make a note of it. + +13. Your imported OVA is now ready to be deployed to a new VM inside your VMO cluster. Execute the following command to + start an interactive shell and begin the deployment process. Replace the path placeholder with the path of your OVA + configuration file. + + ```shell + palette vmo deploy-ova --config-file + ``` + + The Palette CLI prompts you for information regarding the VM you want to deploy. + + | **Parameter** | **Description** | **Values** | + | --------------------------- | ------------------------------------------------- | ---------- | + | **VM Namespace** | The namespace to create your VM into. | | + | **VM Name** | The namespace of your VM. | | + | **Start VM Automatically?** | Indicate whether to start your VM after creation. | `y`/ `N` | + +14. Depending on the configuration of your OVA, you may be prompted to provide additional values for the OVF template + variables. The deployment of your VM should complete within a few minutes. + + + +:::info + +The import may generate a variety of warnings during the deployment process, including many repeated lines +containing the word `(BADINDEX)`. All of these warnings and messages can safely be ignored. If a fatal error is +encountered, Palette CLI will exit completely. + +You may need to make minor edits to the auto-generated VM specification if you want to configure + VLAN for each network interface. +If uploading your image to a `DataVolume` upload fails, you may restart the upload after debugging any CDI issues. Execute the command `palette vmo import-ova --config-file --skip-convert`. + +::: + + + +## Validate + +1. Log into [Palette](https://console.spectrocloud.com). + +2. From the left **Main Menu**, select **Clusters**. Then, choose the VMO cluster that you deployed your OVA to. The + **Overview** tab appears. + +3. Select the **Virtual Machines** tab. Then, select your migration namespace from the **Namespace** drop-down Menu. + Your deployed VM appears in the list of Virtual Machines. Select your VM to view its details. It is in a **Running** + state. + + ![Imported VM details](/deploy-import-ova-guide/vm-management_create-manage-vm_advanced-topics_deploy-import-ova_imported-vm-details.webp) + +4. Even though your VM is healthy, Palette displays two warnings. You can resolve them from the UI. Click **Boot + Order**. The **Virtual machine boot order** dialog appears. + +5. Select a boot source for your VM from the list of available disks. Then, click **Save**. The dialog closes. + + ![Fix boot order](/deploy-import-ova-guide/vm-management_create-manage-vm_advanced-topics_deploy-import-ova_fix-boot-order-warning.webp) + +6. Click the second warning button, named after the clusters **Environment** configuration. Select a new **Serial + Number** for your environment ConfigMap. Then, click **Save**. + + ![Fix configmap serial](/deploy-import-ova-guide/vm-management_create-manage-vm_advanced-topics_deploy-import-ova_fix-serial-number-warning.webp) + +7. Select the **Actions** drop-down Menu. Then, select **Restart** to apply your changes. Once your changes have been + applied, Palette will not display any warnings. diff --git a/docs/docs-content/vm-management/vm-management.md b/docs/docs-content/vm-management/vm-management.md index a7ed3397a6..712e790eb7 100644 --- a/docs/docs-content/vm-management/vm-management.md +++ b/docs/docs-content/vm-management/vm-management.md @@ -56,4 +56,6 @@ and permissions for your VMs. - [Migrate a VM to a VMO cluster](./create-manage-vm/advanced-topics/migrate-vm-kubevirt.md) +- [Import and Deploy OVAs to Palette VMO](./create-manage-vm/advanced-topics/deploy-import-ova.md) + - [RBAC](./rbac/rbac.md) diff --git a/static/assets/docs/images/deploy-import-ova-guide/vm-management_create-manage-vm_advanced-topics_deploy-import-ova_fix-boot-order-warning.webp b/static/assets/docs/images/deploy-import-ova-guide/vm-management_create-manage-vm_advanced-topics_deploy-import-ova_fix-boot-order-warning.webp new file mode 100644 index 0000000000..1c7b1eefe9 Binary files /dev/null and b/static/assets/docs/images/deploy-import-ova-guide/vm-management_create-manage-vm_advanced-topics_deploy-import-ova_fix-boot-order-warning.webp differ diff --git a/static/assets/docs/images/deploy-import-ova-guide/vm-management_create-manage-vm_advanced-topics_deploy-import-ova_fix-serial-number-warning.webp b/static/assets/docs/images/deploy-import-ova-guide/vm-management_create-manage-vm_advanced-topics_deploy-import-ova_fix-serial-number-warning.webp new file mode 100644 index 0000000000..5a623495e1 Binary files /dev/null and b/static/assets/docs/images/deploy-import-ova-guide/vm-management_create-manage-vm_advanced-topics_deploy-import-ova_fix-serial-number-warning.webp differ diff --git a/static/assets/docs/images/deploy-import-ova-guide/vm-management_create-manage-vm_advanced-topics_deploy-import-ova_imported-vm-details.webp b/static/assets/docs/images/deploy-import-ova-guide/vm-management_create-manage-vm_advanced-topics_deploy-import-ova_imported-vm-details.webp new file mode 100644 index 0000000000..12dd33358f Binary files /dev/null and b/static/assets/docs/images/deploy-import-ova-guide/vm-management_create-manage-vm_advanced-topics_deploy-import-ova_imported-vm-details.webp differ