Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions content/software/migration_from_vmware/import_ova.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ The converted VM will reboot several times after instantiation in order to insta

## Usage

The full documentation for OneSwap is maintained in the [OneSwap Wiki](https://github.com/OpenNebula/one-swap/wiki).

OneSwap will assume that the provided OVA has been exported from a VMware environment. Users must make sure that the provided OVA is compatible with VMware environments. Other sources are currently not supported (i.e., Xen or VirtualBox).

When converting an OVA or VMDK you will need enough space both in the `/tmp` folder (can be changed with `--work-dir`) and in the destination DS where the disk images are going to be imported.
When converting an OVA or VMDK you will need enough space both in the `/tmp` folder (can be changed with `--work-dir`) and in the destination Datastore where the disk images are going to be imported.

The parent OVA directory name should match the name of the OVA files inside it. For example

Expand All @@ -65,7 +63,7 @@ ovf_test/
```


It is possible to specify the target Datastore and VNET for the OVA to be imported. Refer to `man oneswap` for the complete documentation of the oneswap command. Available options for the `oneswap import` command are:
It is possible to specify the target Datastore and VNET for the OVA to be imported. Refer to `man oneswap` for the complete documentation of the `oneswap` command. Available options for the `oneswap import` command are:

| Parameter | Description |
|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Expand Down Expand Up @@ -200,11 +198,11 @@ Context will install on first boot, you may need to boot it twice.
```

{{< alert title="Note" color="success" >}}
If context injection does not work after importing, it is also possible to install one-context **before exporting the OVA** from VMware using the packages available in the one-apps repository and uninstalling VMware Tools. In this case it is important to be aware that the one-context service will get rid of any manual network configurations done to the guest OS and the VM won’t be able to get the network configuration from VMware anymore.{{< /alert >}}
If context injection does not work after importing, it is also possible to install `one-context` **before exporting the OVA** from VMware using the packages available in the `one-apps` repository and uninstalling VMware Tools. In this case it is important to be aware that the `one-context` service will get rid of any manual network configurations done to the guest OS and the VM won’t be able to get the network configuration from VMware anymore.{{< /alert >}}

## Additional `virt-v2v` Options

The following parameters can be tuned for virt-v2v, defaults will be applied if no options are provided.
The following parameters can be tuned for `virt-v2v`, defaults will be applied if no options are provided.

| Parameter | Description |
|---------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Expand All @@ -213,8 +211,8 @@ The following parameters can be tuned for virt-v2v, defaults will be applied if
| `--format \| -f name [ qcow2 \| raw ]` | Disk format `[ qcow2 \| raw ]`. Default: `qcow2`. |
| `--virtio /path/to/iso` | Full path of the win-virtio ISO file. Required to inject VirtIO drivers to Windows Guests. |
| `--win-qemu-ga /path/to/iso` | Install QEMU Guest Agent to a Windows guest. |
| `--qemu-ga` | Install qemu-guest-agent package to a Linux guest, useful with `–custom` or `–fallback`. |
| `--qemu-ga` | Install `qemu-guest-agent` package to a Linux guest, useful with `-–custom` or `-–fallback`. |
| `--delete-after` | Removes the leftover conversion directory in the working directory which contains the converted VM disks and descriptor files. |
| `--vddk /path/to/vddk/` | Full path to the VDDK library, required for VDDK-based transfer. |
| `--virt-tools /path/to/virt-tools` | Path to the directory containing `rhsrvany.exe`, defaults to `/usr/local/share/virt-tools`. See [https://github.com/rwmjones/rhsrvany](https://github.com/rwmjones/rhsrvany). |
| `--virt-tools /path/to/virt-tools` | Path to the directory containing `rhsrvany.exe`, defaults to `/usr/local/share/virt-tools`. See [rhsrvany project GitHub page](https://github.com/rwmjones/rhsrvany) for more details. |
| `--root option` | Choose the root filesystem to be converted. Can be `ask`, `single`, `first` or `/dev/sdX`. |
30 changes: 15 additions & 15 deletions content/software/migration_from_vmware/oneswap.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ It can be installed in Ubuntu with
apt install opennebula-swap
```

And in Alma Linux and RHEL with
And in AlmaLinux and RHEL with

```
dnf install opennebula-swap
Expand All @@ -39,7 +39,7 @@ dnf install opennebula-swap
### Requirements and recommended settings

OneSwap requirements for virtual conversion from VMWare to OpenNebula are the following:
- OneSwap is only supported on Ubuntu 24.04 LTS and Alma Linux/RHEL 9 servers. On previous versions of Ubuntu and Alma/RHEL some dependencies are outdated.
- OneSwap is only supported on Ubuntu 24.04 LTS and AlmaLinux/RHEL 9 servers. On previous versions of Ubuntu and AlmaLinux/RHEL some dependencies are outdated.
- A working OpenNebula environment with capacity enough to store imported images and VMs and a user with permissions on the destination datastores. Alternatively, conversion can be done with user `oneadmin` and set the right permissions in a posterior step.
- A vCenter endpoint with valid credentials to export the VMs.
- The parameters `vcenter`, `vuser`, `vpass` and `port` must be specified.
Expand All @@ -52,13 +52,13 @@ Most OneSwap parameters can be configured on the file `/etc/one/oneswap.yaml` bu
{{< /alert >}}

{{< alert color="warning" title="OpenNebula CLI" >}}
If `oneswap` runs from a server different than OpenNebula frontend, [check the documentation]({{% relref "command_line_interface#cli-configuration" %}}) about installing the CLI commands and xport the variables `ONE_XMLRPC` and `ONE_AUTH` accordingly.<br/>
If `oneswap` runs from a server different than OpenNebula frontend, [check the documentation]({{% relref "command_line_interface#cli-configuration" %}}) about installing the CLI commands and export the variables `ONE_XMLRPC` and `ONE_AUTH` accordingly.<br/>
Normally that means populating the file `$HOME/.one/one_auth` with `username:password` and adding `export ONE_XMLRPC=http://opennebula_frontend:2633/RPC2` on the user profile, but it is recommended to check the documentation.
{{< /alert >}}

### Optional requirements and required tools

- VDDK library is recommended to improve disk transfer speeds. As of the moment of writing, the library can be downloaded from [Broadcom developer portal](https://developer.broadcom.com/sdks/vmware-virtual-disk-development-kit-vddk/latest/). VDDK version **MUST** match the vcenter version.
- VDDK library is recommended to improve disk transfer speeds. As of the moment of writing, the library can be downloaded from [Broadcom developer portal](https://developer.broadcom.com/sdks/vmware-virtual-disk-development-kit-vddk/latest/). VDDK version **MUST** match the vCenter version.
- It is recommended to increase the vCenter API timeout to avoid request timeouts while converting big VMs. By default this value is 120 minutes and can be changed in vCenter at "Administration -> Deployment -> Client Configuration", allowing values up to 1440 minutes (24 hours).
- The following libraries/programs must be installed
- `libguestfs` library, version must be >= 1.50
Expand All @@ -72,7 +72,7 @@ Ubuntu 24.04 and AlmaLinux/RHEL 9 provide up to date versions of the packages
There are two requirements to convert Windows Virtual Machines:
- [VirtIO ISO drivers](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso) must be stored in the `/usr/local/share/virtio-win` directory.
- [RHsrvany, an Open Source srvany implementation](https://github.com/rwmjones/rhsrvany) to create the needed Windows services during the migration.
- In Alma Linux and RHEL this package is a dependency of OneSwap and will be installed automatically
- In AlmaLinux and RHEL this package is a dependency of OneSwap and will be installed automatically
- In Ubuntu [the package can be downloaded from fedoraproject.org](https://kojipkgs.fedoraproject.org/packages/mingw-srvany/1.1/11.eln153/noarch/mingw-srvany-redistributable-1.1-11.eln153.noarch.rpm). <br/>
For compatibility with older versions of virt2v the following symlinks are needed

Expand Down Expand Up @@ -105,9 +105,9 @@ OneSwap supports two different modes for the migration of Virtual machines:
- **VMs must be powered on**

### On Linux VMs
- The virtual machine must have the kernel headers installed. The name of the package may differ on each distribution, for instance, in Ubuntu the package to install is `linux-headers` and in Alma Linux is `kernel-headers`.
- The virtual machine must have the kernel headers installed. The name of the package may differ on each distribution, for instance, in Ubuntu the package to install is `linux-headers` and in AlmaLinux is `kernel-headers`.
- The guest kernel version must support virtio drivers (kernel 2.6.30 or greater, which was issued on 2009-07-09).
- virt-v2v tool does not support updating GRUB2, if the following message is shown during the conversion process:
- `virt-v2v` tool does not support updating GRUB2, if the following message is shown during the conversion process:

```
WARNING: could not determine a way to update the configuration of Grub2
Expand All @@ -117,22 +117,22 @@ booting the VM from a rescue CD and fixing grub may be necessary.

### On Windows VMs
- Fast startup must be disabled (Control Panel -> Power Options -> Advanced power settings)
- Installing (VirtIO Storage and Network drivers \(available at their github\))[https://github.com/virtio-win/virtio-win-pkg-scripts/blob/master/README.md] before the conversion will improve conversion times. If not, they will be injected later.
- Installing VirtIO Storage and Network drivers available at their [github](https://github.com/virtio-win/virtio-win-pkg-scripts/blob/master/README.md) before the conversion will improve conversion times. If not, they will be injected later.
- Officially, Windows 2016 and onwards **require** UEFI boot.
- Windows VMs can only be converted with virt-v2v style transfer (`custom` and `fallback` styles will fail)
- Windows VMs can only be converted with `virt-v2v` style transfer (`custom` and `fallback` styles will fail)

### Virtual machines with UEFI BIOS
OneSwap normally detects if the VM boots in UEFI mode and sets up OpenNebula template accordingly, but in some strange cases autodetection may fail. In these cases, modify the following options on the OpenNebula template:
- CPU architecture: `x86_64`
- Machine type: `q35`
- UEFI firmware: UEFI (for secure firmware the box must be checked)
- UEFI firmware: `UEFI` (for secure firmware the box must be checked)
![Setting up UEFI boot after oneswap migration](/images/oneswap/modify_UEFI.png)

## `oneswap` usage

### Transfer methods

There are four methods to transfer the images from ESX to OpenNebula. Ordered from faster to slowest:
There are four methods to transfer the images from ESXi to OpenNebula. Ordered from faster to slowest:

- **Hybrid**
- Use [RbVmomi2](https://github.com/ManageIQ/rbvmomi2) library to download locally the image before importing to OpenNebula.
Expand All @@ -146,16 +146,16 @@ There are four methods to transfer the images from ESX to OpenNebula. Ordered fr
- **vCenter API**
- The slowest option (vCenter API is used to download the image).

A custom conversion option is also provided, which is only recommended as a fallback, that does not use virt-v2v. It relies on RbVmomi2, using qemu-img and virt-customize/guestfish to prepare the image for OpenNebula.
A custom conversion option is also provided, which is only recommended as a fallback, that does not use `virt-v2v`. It relies on `RbVmomi2`, using `qemu-img` and `virt-customize`/`guestfish` to prepare the image for OpenNebula.

### Importing VMs

Before migrations, `oneswap` can query ESX VMs and datacenters
Before migrations, `oneswap` can query ESXi VMs and datacenters

| Command | Output |
| --- | --- |
| `oneswap list datacenters` | Lists Datacenters |
| `oneswap list clusters [--datacenter DCName]` | List clusters (can filter by datacenter) |
| `oneswap list vms [--datacenter DCName [--cluster ClusterName]]` | List VMs on ESX. Cluster needs the Datacenter name. |
| `oneswap list vms [--datacenter DCName [--cluster ClusterName]]` | List VMs on ESXi. Cluster needs the Datacenter name. |

For convenience, it is a good practice to populate the `/etc/one/oneswap.yaml` file with the values that will apply for most migrated VMs. If the user running oneswap has no permissions to edit the file, it can be copied, modified and execute `oneswap` with the parameter `--config-file NEW_CONFIG_FILE.yaml`
For convenience, it is a good practice to populate the `/etc/one/oneswap.yaml` file with the values that will be applied for the most migrated VMs. If the user running `oneswap` has no permissions to edit the file, it can be copied, modified and `oneswap` be executed with the parameter `--config-file NEW_CONFIG_FILE.yaml`