diff --git a/docs/docs-content/automation/palette-cli/commands/vmo.md b/docs/docs-content/automation/palette-cli/commands/vmo.md new file mode 100644 index 0000000000..ffbbcc70bb --- /dev/null +++ b/docs/docs-content/automation/palette-cli/commands/vmo.md @@ -0,0 +1,69 @@ +--- +sidebar_label: "VMO" +title: "VMO" +description: "Reference resource for the vmo command." +hide_table_of_contents: false +sidebar_position: 60 +tags: ["palette-cli"] +--- + +Use the `vmo` command to migrate Virtual Machines (VMs) and import and deploy vSphere Open Virtual Appliances (OVAs). +The VMs can then be used with the Virtual Machine Orchestrator (VMO). + +## Subcommands + +- [`deploy-ova`](#deploy-ova) - Deploy an imported vSphere OVA. This command requires you to have an OVA deployment file. If you do not + have one, you can generate an OVA with the `import-ova` subcommand. + +- [`import-ova`](#import-ova) - Import a vSphere OVA. This subcommand will generate an OVA deployment configuration file. The + configuration can then be deployed using the `deploy-ova` subcommand. + +- [`migrate-vm`](#migrate-vm) - Migrate one or more VMware vSphere VMs to Palette VMO. + +## Prerequisites + +- A Healthy VMO cluster. Refer to the [Create a VMO Profile](../../../vm-management/create-vmo-profile.md) for further guidance. +- One or more VMs hosted in VMware vSphere. The VMs should also operate one the + [`virt-v2v` supported guest systems](https://libguestfs.org/virt-v2v-support.1.html). + +## Limitations + +- You can only use the `vmo` subcommand with VMs hosted in VMware vSphere. + + +## 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. + +| **Short Flag** | **Long Flag** | **Description** | **Type** | +| -------------- | --------------- | -------------------------------------------------------------------------------------------- | -------- | +| `-f` | `--config-file` | Specifies an OVA configuration file. | string | +| `-o` | `--config-only` | Update the OVA configuration file only, without proceeding with the deployment. | boolean | +| `-s` | `--silent` | Perform a silent OVA deployment. This flag requires the `--config-file` be specified. | boolean | +| `-h` | `--help` | Help for the `deploy-ova` subcommand. | - | + +## Import OVA + +Use the `import-ova` subcommand to import a vSphere OVA to Palette VMO. The following flags are supported by the +`import-ova` subcommand. + +| **Short Flag** | **Long Flag** | **Description** | **Type** | +| -------------- | ---------------- | ----------------------------------------------------------------------------- | -------- | +| `-f` | `--config-file` | Specifies an OVA configuration file. | string | +| `-o` | `--config-only` | Generate the OVA configuration file only, without proceeding with the import. | boolean | +| | `--skip-convert` | Skip OVA conversion. | boolean | +| | `--skip-image` | Skip VM image upload. | boolean | +| `-h` | `--help` | Help for the `deploy-ova` subcommand. | - | + +## Migrate VM + +Use the `migrate-vm` subcommand to migrate one or more VM(s) from VMware vSphere to Palette VMO. The following flags are supported by +the `migrate-vm` subcommand. + +| **Short Flag** | **Long Flag** | **Description** | **Type** | +| -------------- | --------------- | -------------------------------------------------------------------------------------------- | -------- | +| `-f` | `--config-file` | Specifies a configuration file for the VM migration. | string | +| `-o` | `--config-only` | Generate the migration configuration file only, without proceeding with the migration. | boolean | +| `-p` | `--update-passwords` | Update the vSphere and ESXi passwords save in the configuration file. This flag requires the `--config-file` to be specified. | boolean | +| `-h` | `--help` | Help for the `migrate-vm` subcommand. | - | diff --git a/docs/docs-content/vm-management/create-manage-vm/advanced-topics/migrate-vm-kubevirt.md b/docs/docs-content/vm-management/create-manage-vm/advanced-topics/migrate-vm-kubevirt.md new file mode 100644 index 0000000000..82554740f5 --- /dev/null +++ b/docs/docs-content/vm-management/create-manage-vm/advanced-topics/migrate-vm-kubevirt.md @@ -0,0 +1,118 @@ +--- +sidebar_label: "Migrate a VM to a VMO cluster" +title: "Migrate a VM to a VMO cluster" +description: "Learn how to migrate VMs to Palette VMO using the Palette CLI." +icon: " " +hide_table_of_contents: false +sidebar_position: 40 +tags: ["vmo", "palette-cli"] +--- + +During large scale Kubernetes adoptions, workloads are often rehosted or migrated instead of being redeployed from +scratch. This process allows system administrators to copy the application, together with its data, to a Kubernetes +cluster. This process can be time consuming if done manually, so it is often automated with open-source tools such as +[Forklift](https://github.com/kubev2v/forklift). + +The [Palette CLI](../../../automation/palette-cli/palette-cli.md) provides the ability to migrate Virtual Machines (VMs) +from VMware vSphere to Palette VMO. + +## Limitations + +- You can only migrate VMs hosted in VMware vSphere. + +## Prerequisites + +- A Healthy VMO cluster. Refer to the [Create a VMO Profile](../../create-vmo-profile.md) for further guidance. +- One or more VMs hosted in VMware vSphere. The VMs should also operate one the + [`virt-v2v` supported guest systems](https://libguestfs.org/virt-v2v-support.1.html). + - The VMs must be powered off before migration. +- The Palette CLI installed and setup. Refer to the + [Installation](../../../automation/palette-cli/install-palette-cli.md) guide for further details. + - The kubectl command-line tool should also be installed. Refer to the + [kubectl installation](https://kubernetes.io/docs/tasks/tools/install-kubectl/) guide to learn more. + +:::warning + +The VMO cluster must have access to VMware and the VM you want to migrate. The Palette CLI must have access to both the +VMO cluster and the machines to be migrated. + +::: + +## Migrate VMware vSphere VMs + +1. Download the [Kubeconfig](../../../clusters/cluster-management/kubeconfig.md) file of the VMO cluster to the host + where the Palette CLI is installed. + +2. Open a terminal window and set the environment variable `KUBECONFIG` to point to the file you downloaded. + + ```shell + export KUBECONFIG= + ``` + +3. Optionally, create a namespace where your VM will be migrated. + + ```shell + kubectl create namespaces + ``` + +4. Execute the following command to start an interactive shell and begin the migration process to the cluster specified + by the `KUBECONFIG` variable. + + ```shell + palette vmo migrate-vm + ``` + + The Palette CLI prompts you for information regarding the VM you want to migrate, vSphere environment, and resource + configurations. + + | **Parameter** | **Description** | **Values** | + | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | + | **Migration Source Type** | The hypervisor configured on your migration VM. | `vCenter` / `vCenter + ESXi host` | + | **Migration Name** | The name of your migration and its corresponding configuration files. A default name is generated by the Palette CLI. | | + | **Forklift Installation Type** | A cluster to be used for performing the migration. You can either choose to create a local cluster or use the destination cluster. [Forklift](https://github.com/kubev2v/forklift) is installed on the migration cluster. | `Local Kind Cluster` / `Destination Cluster` | + | **Install Forklift?** | Specify whether to install Forklift on the migration cluster. | `Y` / `n` | + | **Migration Namespace** | Namespace where the migration VM is created. The namespace must exist on the cluster. You can enter the namespace you created earlier or use the `default` namespace. | | + | **vSphere Endpoint** | Your vSphere endpoint. You can specify a Full Qualified Domain Name (FQDN) or an IP address. Make sure you specify the endpoint without the HTTP scheme `https://` or `http://`. Example: `vcenter.mycompany.com.` | | + | **vSphere Username (with domain)** | Your vSphere account username. | | + | **vSphere Password** | Your vSphere account password. | | + | **Allow Insecure Connection (Bypass x509 Verification)** | Enabling this option bypasses x509 CA verification. In production environments, enter `N` if using a custom registry with self-signed SSL certificates. Otherwise, enter `Y`. | `Y`/`n` | + | **Datacenter** | The vSphere data center of the VM to migrate. | | + | **Cluster** | The vSphere compute cluster of the VM to migrate. | | + | **ESXi Hypervisor** | The IP address of the node corresponding to the VM to migrate. If you have selected the `vCenter + ESXi host` migration source type, you will need to provide ESXi credentials. | | + | **VM** | The VM to migrate from the selected host. | | + | **Add Another VM?** | Indicate whether you want to select multiple VM from the vSphere environment. | `Y` / `n` | + | **Add Another Host?** | Indicate whether you would like to perform two migrations in the same configuration. | | + | **Destination Network Type** | The network that the VMs will be mapped to in the VMO cluster. | `pod` / `multus` | + | **Destination StorageClass** | The storage class on the destination that will be used to create the VM volumes. | | + | **Destination StorageClass Access Mode** | The configured access moded on the cluster storage class. | `ReadWriteOnce` / `ReadWriteMany` | + +5. The migration begins as soon as you complete the configuration. Execute the following command to watch the migration + status. + + ```shell + watch -n 2 'kubectl -n konveyor-forklift get migrations.forklift.konveyor.io -migration' + ``` + + The migration with take approximately 20 minutes, depending on the size of the VM to migrate. Once the migration is + comeplete, the `watch` command will output the following. + + ```shell + Every 2.0s: kubectl -n konveyor-forklift get migrations.forklift.konveyor.io vmo-migration + + NAME READY RUNNING SUCCEEDED FAILED AGE + vmo-migration True True 18m + ``` + +## Validate + +1. Log into [Palette](https://console.spectrocloud.com). + +2. From the left **Main Menu**, select **Clusters**. Then, choose the VMO cluster that you migrated your VM to. The + **Overview** tab appears. + +3. Select the **Virtual Machines** tab. Then, select your migration namespace from the **Namespace** drop-down Menu. + Your migrated VM appears. + +4. Click on the **three-dot Menu** and select **Start**. Your VM is now ready to use. + + ![Start migrated vm](/migrate-vm-kubevirt-guide/vm-management_create-manage-vm_migrate-vm-kubevirt_start_migrated_vm.webp) diff --git a/static/assets/docs/images/migrate-vm-kubevirt-guide/vm-management_create-manage-vm_migrate-vm-kubevirt_start_migrated_vm.webp b/static/assets/docs/images/migrate-vm-kubevirt-guide/vm-management_create-manage-vm_migrate-vm-kubevirt_start_migrated_vm.webp new file mode 100644 index 0000000000..72891ba1b6 Binary files /dev/null and b/static/assets/docs/images/migrate-vm-kubevirt-guide/vm-management_create-manage-vm_migrate-vm-kubevirt_start_migrated_vm.webp differ