Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 11. Migrating virtual machines from the command line
You can migrate virtual machines to OpenShift Virtualization from the command line.
You must ensure that all prerequisites are met.
11.1. Permissions needed by non-administrators to work with migration plan components Copier lienLien copié sur presse-papiers!
If you are an administrator, you can work with all components of migration plans (for example, providers, network mappings, and migration plans).
By default, non-administrators have limited ability to work with migration plans and their components. As an administrator, you can modify their roles to allow them full access to all components, or you can give them limited permissions.
For example, administrators can assign non-administrators one or more of the following cluster roles for migration plans:
| Role | Description |
|---|---|
|
| Can view migration plans but not to create, delete or modify them |
|
|
Can create, delete or modify (all parts of |
|
|
All |
Note that pre-defined cluster roles include a resource (for example, plans), an API group (for example, forklift.konveyor.io-v1beta1) and an action (for example, view, edit).
As a more comprehensive example, you can grant non-administrators the following set of permissions per namespace:
- Create and modify storage maps, network maps, and migration plans for the namespaces they have access to
- Attach providers created by administrators to storage maps, network maps, and migration plans
- Not be able to create providers or to change system settings
| Actions | API group | Resource |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Empty string |
|
Non-administrators need to have the create permissions that are part of edit roles for network maps and for storage maps to create migration plans, even when using a template for a network map or a storage map.
11.2. Migrating virtual machines Copier lienLien copié sur presse-papiers!
You migrate virtual machines (VMs) using the command-line interface (CLI) by creating MTV custom resources (CRs). The CRs and the migration procedure vary by source provider.
You must specify a name for cluster-scoped CRs.
You must specify both a name and a namespace for namespace-scoped CRs.
To migrate to or from an OpenShift cluster that is different from the one the migration plan is defined on, you must have an OpenShift Virtualization service account token with cluster-admin privileges.
11.3. Migrating from a VMware vSphere source provider Copier lienLien copié sur presse-papiers!
You can migrate from a VMware vSphere source provider by using the command-line interface (CLI).
Procedure
Create a
Secretmanifest for the source provider credentials:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
ownerReferencessection is optional. - 2
- Specify the vCenter user or the ESX/ESXi user.
- 3
- Specify the password of the vCenter user or the ESX/ESXi user.
- 4
- Specify
"true"to skip certificate verification, and specify"false"to verify the certificate. Defaults to"false"if not specified. Skipping certificate verification proceeds with an insecure migration and then the certificate is not required. Insecure migration means that the transferred data is sent over an insecure connection and potentially sensitive data could be exposed. - 5
- When this field is not set and skip certificate verification is disabled, MTV attempts to use the system CA.
- 6
- Specify the API endpoint URL of the vCenter or the ESX/ESXi, for example,
https://<vCenter_host>/sdk.
Create a
Providermanifest for the source provider:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify the URL of the API endpoint, for example,
https://<vCenter_host>/sdk. - 2
- Optional, but it is strongly recommended to create a VDDK image to accelerate migrations. Follow OpenShift documentation to specify the VDDK image you created.
- 3
- Options:
vcenteroresxi. - 4
- Specify the name of the provider
SecretCR.
Create a
Hostmanifest:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify the name of the VMware vSphere
ProviderCR. - 2
- Specify the Managed Object Reference (moRef) of the VMware vSphere host. To retrieve the moRef, see Retrieving a VMware vSphere moRef.
- 3
- Specify the IP address of the VMware vSphere migration network.
Create a
NetworkMapmanifest to map the source and destination networks:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Allowed values are
podandmultus. - 2
- You can use either the
idor thenameparameter to specify the source network. Forid, specify the VMware vSphere network Managed Object Reference (moRef). To retrieve the moRef, see Retrieving a VMware vSphere moRef. - 3
- Specify a network attachment definition for each additional OpenShift Virtualization network.
- 4
- Required only when
typeismultus. Specify the namespace of the OpenShift Virtualization network attachment definition.
Create a
StorageMapmanifest to map source and destination storage:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Allowed values are
ReadWriteOnceandReadWriteMany. - 2
- Specify the VMware vSphere datastore moRef. For example,
f2737930-b567-451a-9ceb-2887f6207009. To retrieve the moRef, see Retrieving a VMware vSphere moRef.
Optional: Create a
Hookmanifest to run custom code on a VM during the phase specified in thePlanCR:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou can use the default
hook-runnerimage or specify a custom image. If you specify a custom image, you do not have to specify a playbook.
Create a
Planmanifest for the migration:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify the name of the
PlanCR. - 2
- Specify whether the migration is warm -
true- or cold -false. If you specify a warm migration without specifying a value for thecutoverparameter in theMigrationmanifest, only the precopy stage will run. - 3
- Specify only one network map and one storage map per plan.
- 4
- Specify a network mapping even if the VMs to be migrated are not assigned to a network. The mapping can be empty in this case.
- 5
- Specify the name of the
NetworkMapCR. - 6
- Specify a storage mapping even if the VMs to be migrated are not assigned with disk images. The mapping can be empty in this case.
- 7
- Specify the name of the
StorageMapCR. - 8
- By default, virtual network interface controllers (vNICs) change during the migration process. As a result, vNICs that are configured with a static IP linked to the interface name in the guest VM lose their IP. To avoid this, set
preserveStaticIPstotrue. MTV issues a warning message about any VMs for which vNIC properties are missing. To retrieve any missing vNIC properties, run those VMs in vSphere in order for the vNIC properties to be reported to MTV. - 9
- You can use either the
idor thenameparameter to specify the source VMs. - 10
- Specify the VMware vSphere VM moRef. To retrieve the moRef, see Retrieving a VMware vSphere moRef.
- 11
- Optional: You can specify up to two hooks for a VM. Each hook must run during a separate migration step.
- 12
- Specify the name of the
HookCR. - 13
- Allowed values are
PreHook, before the migration plan starts, orPostHook, after the migration is complete.
ImportantWhen you migrate a VMware 7 VM to an OpenShift 4.13+ platform that uses CentOS 7.9, the name of the network interfaces changes and the static IP configuration for the VM no longer works.
Create a
Migrationmanifest to run thePlanCR:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you specify a cutover time, use the ISO 8601 format with the UTC time offset, for example,
2024-04-04T01:23:45.678+09:00.
There is an issue with the forklift-controller consistently failing to reconcile a migration plan, and subsequently returning an HTTP 500 error. This issue is caused when you specify the user permissions only on the virtual machine (VM).
In MTV, you need to add permissions at the datacenter level, which includes storage, networks, switches, and so on, which are used by the VM. You must then propagate the permissions to the child elements.
If you do not want to add this level of permissions, you must manually add the permissions to each object on the VM host required.
11.3.1. Retrieving a VMware vSphere moRef Copier lienLien copié sur presse-papiers!
When you migrate VMs with a VMware vSphere source provider using Migration Toolkit for Virtualization (MTV) from the command line, you need to know the managed object reference (moRef) of certain entities in vSphere, such as datastores, networks, and VMs.
You can retrieve the moRef of one or more vSphere entities from the Inventory service. You can then use each moRef as a reference for retrieving the moRef of another entity.
Procedure
Retrieve the routes for the project:
oc get route -n openshift-mtv
oc get route -n openshift-mtvCopy to Clipboard Copied! Toggle word wrap Toggle overflow Retrieve the
Inventoryservice route:oc get route <inventory_service> -n openshift-mtv
$ oc get route <inventory_service> -n openshift-mtvCopy to Clipboard Copied! Toggle word wrap Toggle overflow Retrieve the access token:
TOKEN=$(oc whoami -t)
$ TOKEN=$(oc whoami -t)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Retrieve the moRef of a VMware vSphere provider:
curl -H "Authorization: Bearer $TOKEN" https://<inventory_service_route>/providers/vsphere -k
$ curl -H "Authorization: Bearer $TOKEN" https://<inventory_service_route>/providers/vsphere -kCopy to Clipboard Copied! Toggle word wrap Toggle overflow Retrieve the datastores of a VMware vSphere source provider:
curl -H "Authorization: Bearer $TOKEN" https://<inventory_service_route>/providers/vsphere/<provider id>/datastores/ -k
$ curl -H "Authorization: Bearer $TOKEN" https://<inventory_service_route>/providers/vsphere/<provider id>/datastores/ -kCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
In this example, the moRef of the datastore v2v_general_porpuse_ISCSI_DC is datastore-11 and the moRef of the datastore f01-h27-640-SSD_2 is datastore-730.
11.3.2. Canceling a migration from the command-line interface Copier lienLien copié sur presse-papiers!
You can use the command-line interface (CLI) to cancel either an entire migration or the migration of specific virtual machines (VMs) while a migration is in progress.
Canceling an entire migration
Delete the
MigrationCR:oc delete migration <migration> -n <namespace>
$ oc delete migration <migration> -n <namespace>1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify the name of the
MigrationCR.
Canceling the migration of specific VMs
Add the specific VMs to the
spec.cancelblock of theMigrationmanifest:Example YAML for canceling the migrations of two VMs
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- You can specify a VM by using the
idkey or thenamekey.
The value of the
idkey is the managed object reference, for a VMware VM, or the VM UUID, for a RHV VM.Retrieve the
MigrationCR to monitor the progress of the remaining VMs:oc get migration/<migration> -n <namespace> -o yaml
$ oc get migration/<migration> -n <namespace> -o yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
11.4. Migrating from a Red Hat Virtualization source provider Copier lienLien copié sur presse-papiers!
You can migrate from a Red Hat Virtualization (RHV) source provider by using the command-line interface (CLI).
Prerequisites
If you are migrating a virtual machine with a direct LUN disk, ensure that the nodes in the OpenShift Virtualization destination cluster that the VM is expected to run on can access the backend storage.
- Unlike disk images that are copied from a source provider to a target provider, LUNs are detached, but not removed, from virtual machines in the source provider and then attached to the virtual machines (VMs) that are created in the target provider.
- LUNs are not removed from the source provider during the migration in case fallback to the source provider is required. However, before re-attaching the LUNs to VMs in the source provider, ensure that the LUNs are not used by VMs on the target environment at the same time, which might lead to data corruption.
Procedure
Create a
Secretmanifest for the source provider credentials:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
ownerReferencessection is optional. - 2
- Specify the RHV Manager user.
- 3
- Specify the user password.
- 4
- Specify
"true"to skip certificate verification, and specify"false"to verify the certificate. Defaults to"false"if not specified. Skipping certificate verification proceeds with an insecure migration and then the certificate is not required. Insecure migration means that the transferred data is sent over an insecure connection and potentially sensitive data could be exposed. - 5
- Enter the Manager CA certificate, unless it was replaced by a third-party certificate, in which case, enter the Manager Apache CA certificate. You can retrieve the Manager CA certificate at https://<engine_host>/ovirt-engine/services/pki-resource?resource=ca-certificate&format=X509-PEM-CA.
- 6
- Specify the API endpoint URL, for example,
https://<engine_host>/ovirt-engine/api.
Create a
Providermanifest for the source provider:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a
NetworkMapmanifest to map the source and destination networks:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Allowed values are
podandmultus. - 2
- You can use either the
idor thenameparameter to specify the source network. Forid, specify the RHV network Universal Unique ID (UUID). - 3
- Specify a network attachment definition for each additional OpenShift Virtualization network.
- 4
- Required only when
typeismultus. Specify the namespace of the OpenShift Virtualization network attachment definition.
Create a
StorageMapmanifest to map source and destination storage:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Create a
Hookmanifest to run custom code on a VM during the phase specified in thePlanCR:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou can use the default
hook-runnerimage or specify a custom image. If you specify a custom image, you do not have to specify a playbook.
Create a
Planmanifest for the migration:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify the name of the
PlanCR. - 2
- See note below.
- 3
- Specify whether the migration is warm or cold. If you specify a warm migration without specifying a value for the
cutoverparameter in theMigrationmanifest, only the precopy stage will run. - 4
- Specify only one network map and one storage map per plan.
- 5
- Specify a network mapping even if the VMs to be migrated are not assigned to a network. The mapping can be empty in this case.
- 6
- Specify the name of the
NetworkMapCR. - 7
- Specify a storage mapping even if the VMs to be migrated are not assigned with disk images. The mapping can be empty in this case.
- 8
- Specify the name of the
StorageMapCR. - 9
- You can use either the
idor thenameparameter to specify the source VMs. - 10
- Specify the RHV VM UUID.
- 11
- Optional: You can specify up to two hooks for a VM. Each hook must run during a separate migration step.
- 12
- Specify the name of the
HookCR. - 13
- Allowed values are
PreHook, before the migration plan starts, orPostHook, after the migration is complete.
Note-
If the migrated machine is set with a custom CPU model, it will be set with that CPU model in the destination cluster, regardless of the setting of
preserveClusterCpuModel. If the migrated machine is not set with a custom CPU model:
-
If
preserveClusterCpuModelis set to 'true`, MTV checks the CPU model of the VM when it runs in RHV, based on the cluster’s configuration, and then sets the migrated VM with that CPU model. -
If
preserveClusterCpuModelis set to 'false`, MTV does not set a CPU type and the VM is set with the default CPU model of the destination cluster.
-
If
Create a
Migrationmanifest to run thePlanCR:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you specify a cutover time, use the ISO 8601 format with the UTC time offset, for example,
2024-04-04T01:23:45.678+09:00.
11.4.1. Canceling a migration from the command-line interface Copier lienLien copié sur presse-papiers!
You can use the command-line interface (CLI) to cancel either an entire migration or the migration of specific virtual machines (VMs) while a migration is in progress.
Canceling an entire migration
Delete the
MigrationCR:oc delete migration <migration> -n <namespace>
$ oc delete migration <migration> -n <namespace>1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify the name of the
MigrationCR.
Canceling the migration of specific VMs
Add the specific VMs to the
spec.cancelblock of theMigrationmanifest:Example YAML for canceling the migrations of two VMs
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- You can specify a VM by using the
idkey or thenamekey.
The value of the
idkey is the managed object reference, for a VMware VM, or the VM UUID, for a RHV VM.Retrieve the
MigrationCR to monitor the progress of the remaining VMs:oc get migration/<migration> -n <namespace> -o yaml
$ oc get migration/<migration> -n <namespace> -o yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
11.5. Migrating from an OpenStack source provider Copier lienLien copié sur presse-papiers!
You can migrate from an OpenStack source provider by using the command-line interface (CLI).
Procedure
Create a
Secretmanifest for the source provider credentials:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
ownerReferencessection is optional. - 2
- Specify the OpenStack user.
- 3
- Specify the user OpenStack password.
- 4
- Specify
"true"to skip certificate verification, and specify"false"to verify the certificate. Defaults to"false"if not specified. Skipping certificate verification proceeds with an insecure migration and then the certificate is not required. Insecure migration means that the transferred data is sent over an insecure connection and potentially sensitive data could be exposed. - 5
- When this field is not set and skip certificate verification is disabled, MTV attempts to use the system CA.
- 6
- Specify the API endpoint URL, for example,
https://<identity_service>/v3.
Create a
Providermanifest for the source provider:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a
NetworkMapmanifest to map the source and destination networks:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Allowed values are
podandmultus. - 2
- You can use either the
idor thenameparameter to specify the source network. Forid, specify the OpenStack network UUID. - 3
- Specify a network attachment definition for each additional OpenShift Virtualization network.
- 4
- Required only when
typeismultus. Specify the namespace of the OpenShift Virtualization network attachment definition.
Create a
StorageMapmanifest to map source and destination storage:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Create a
Hookmanifest to run custom code on a VM during the phase specified in thePlanCR:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou can use the default
hook-runnerimage or specify a custom image. If you specify a custom image, you do not have to specify a playbook.
Create a
Planmanifest for the migration:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify the name of the
PlanCR. - 2
- Specify only one network map and one storage map per plan.
- 3
- Specify a network mapping, even if the VMs to be migrated are not assigned to a network. The mapping can be empty in this case.
- 4
- Specify the name of the
NetworkMapCR. - 5
- Specify a storage mapping, even if the VMs to be migrated are not assigned with disk images. The mapping can be empty in this case.
- 6
- Specify the name of the
StorageMapCR. - 7
- You can use either the
idor thenameparameter to specify the source VMs. - 8
- Specify the OpenStack VM UUID.
- 9
- Optional: You can specify up to two hooks for a VM. Each hook must run during a separate migration step.
- 10
- Specify the name of the
HookCR. - 11
- Allowed values are
PreHook, before the migration plan starts, orPostHook, after the migration is complete.
Create a
Migrationmanifest to run thePlanCR:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you specify a cutover time, use the ISO 8601 format with the UTC time offset, for example,
2024-04-04T01:23:45.678+09:00.
11.5.1. Canceling a migration from the command-line interface Copier lienLien copié sur presse-papiers!
You can use the command-line interface (CLI) to cancel either an entire migration or the migration of specific virtual machines (VMs) while a migration is in progress.
Canceling an entire migration
Delete the
MigrationCR:oc delete migration <migration> -n <namespace>
$ oc delete migration <migration> -n <namespace>1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify the name of the
MigrationCR.
Canceling the migration of specific VMs
Add the specific VMs to the
spec.cancelblock of theMigrationmanifest:Example YAML for canceling the migrations of two VMs
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- You can specify a VM by using the
idkey or thenamekey.
The value of the
idkey is the managed object reference, for a VMware VM, or the VM UUID, for a RHV VM.Retrieve the
MigrationCR to monitor the progress of the remaining VMs:oc get migration/<migration> -n <namespace> -o yaml
$ oc get migration/<migration> -n <namespace> -o yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
11.6. Migrating from an Open Virtual Appliance (OVA) source provider Copier lienLien copié sur presse-papiers!
You can migrate from Open Virtual Appliance (OVA) files that were created by VMware vSphere as a source provider by using the command-line interface (CLI).
Procedure
Create a
Secretmanifest for the source provider credentials:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a
Providermanifest for the source provider:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a
NetworkMapmanifest to map the source and destination networks:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Allowed values are
podandmultus. - 2
- Specify the OVA network Universal Unique ID (UUID).
- 3
- Specify a network attachment definition for each additional OpenShift Virtualization network.
- 4
- Required only when
typeismultus. Specify the namespace of the OpenShift Virtualization network attachment definition.
Create a
StorageMapmanifest to map source and destination storage:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Allowed values are
ReadWriteOnceandReadWriteMany. - 2
- For OVA, the
StorageMapcan map only a single storage, which all the disks from the OVA are associated with, to a storage class at the destination. For this reason, the storage is referred to in the UI as "Dummy storage for source provider <provider_name>". In the YAML, write the phrase as it appears above, without the quotation marks and replacing <provider_name> with the actual name of the provider.
Optional: Create a
Hookmanifest to run custom code on a VM during the phase specified in thePlanCR:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou can use the default
hook-runnerimage or specify a custom image. If you specify a custom image, you do not have to specify a playbook.
Create a
Planmanifest for the migration:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify the name of the
PlanCR. - 2
- Specify only one network map and one storage map per plan.
- 3
- Specify a network mapping, even if the VMs to be migrated are not assigned to a network. The mapping can be empty in this case.
- 4
- Specify the name of the
NetworkMapCR. - 5
- Specify a storage mapping even if the VMs to be migrated are not assigned with disk images. The mapping can be empty in this case.
- 6
- Specify the name of the
StorageMapCR. - 7
- You can use either the
idor thenameparameter to specify the source VMs. - 8
- Specify the OVA VM UUID.
- 9
- Optional: You can specify up to two hooks for a VM. Each hook must run during a separate migration step.
- 10
- Specify the name of the
HookCR. - 11
- Allowed values are
PreHook, before the migration plan starts, orPostHook, after the migration is complete.
Create a
Migrationmanifest to run thePlanCR:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you specify a cutover time, use the ISO 8601 format with the UTC time offset, for example,
2024-04-04T01:23:45.678+09:00.
11.6.1. Canceling a migration from the command-line interface Copier lienLien copié sur presse-papiers!
You can use the command-line interface (CLI) to cancel either an entire migration or the migration of specific virtual machines (VMs) while a migration is in progress.
Canceling an entire migration
Delete the
MigrationCR:oc delete migration <migration> -n <namespace>
$ oc delete migration <migration> -n <namespace>1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify the name of the
MigrationCR.
Canceling the migration of specific VMs
Add the specific VMs to the
spec.cancelblock of theMigrationmanifest:Example YAML for canceling the migrations of two VMs
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- You can specify a VM by using the
idkey or thenamekey.
The value of the
idkey is the managed object reference, for a VMware VM, or the VM UUID, for a RHV VM.Retrieve the
MigrationCR to monitor the progress of the remaining VMs:oc get migration/<migration> -n <namespace> -o yaml
$ oc get migration/<migration> -n <namespace> -o yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
11.7. Migrating from a Red Hat OpenShift Virtualization source provider Copier lienLien copié sur presse-papiers!
You can use a Red Hat OpenShift Virtualization provider as either a source provider or as a destination provider. You can migrate from an OpenShift Virtualization source provider by using the command-line interface (CLI).
Procedure
Create a
Secretmanifest for the source provider credentials:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
ownerReferencessection is optional. - 2
- Specify a token for a service account with
cluster-adminprivileges. If bothtokenandurlare left blank, the local OpenShift cluster is used. - 3
- Specify the user password.
- 4
- Specify
"true"to skip certificate verification, and specify"false"to verify the certificate. Defaults to"false"if not specified. Skipping certificate verification proceeds with an insecure migration and then the certificate is not required. Insecure migration means that the transferred data is sent over an insecure connection and potentially sensitive data could be exposed. - 5
- When this field is not set and skip certificate verification is disabled, MTV attempts to use the system CA.
- 6
- Specify the URL of the endpoint of the API server.
Create a
Providermanifest for the source provider:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a
NetworkMapmanifest to map the source and destination networks:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Allowed values are
podandmultus. - 2
- Specify a network attachment definition for each additional OpenShift Virtualization network. Specify the
namespaceeither by using thenamespace propertyor with a name built as follows:<network_namespace>/<network_name>. - 3
- Required only when
typeismultus. Specify the namespace of the OpenShift Virtualization network attachment definition.
Create a
StorageMapmanifest to map source and destination storage:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Allowed values are
ReadWriteOnceandReadWriteMany.
Optional: Create a
Hookmanifest to run custom code on a VM during the phase specified in thePlanCR:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou can use the default
hook-runnerimage or specify a custom image. If you specify a custom image, you do not have to specify a playbook.
Create a
Planmanifest for the migration:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify the name of the
PlanCR. - 2
- Specify only one network map and one storage map per plan.
- 3
- Specify a network mapping, even if the VMs to be migrated are not assigned to a network. The mapping can be empty in this case.
- 4
- Specify the name of the
NetworkMapCR. - 5
- Specify a storage mapping, even if the VMs to be migrated are not assigned with disk images. The mapping can be empty in this case.
- 6
- Specify the name of the
StorageMapCR. - 7
- Optional: You can specify up to two hooks for a VM. Each hook must run during a separate migration step.
- 8
- Specify the name of the
HookCR. - 9
- Allowed values are
PreHook, before the migration plan starts, orPostHook, after the migration is complete.
Create a
Migrationmanifest to run thePlanCR:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you specify a cutover time, use the ISO 8601 format with the UTC time offset, for example,
2024-04-04T01:23:45.678+09:00.
11.7.1. Canceling a migration from the command-line interface Copier lienLien copié sur presse-papiers!
You can use the command-line interface (CLI) to cancel either an entire migration or the migration of specific virtual machines (VMs) while a migration is in progress.
Canceling an entire migration
Delete the
MigrationCR:oc delete migration <migration> -n <namespace>
$ oc delete migration <migration> -n <namespace>1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify the name of the
MigrationCR.
Canceling the migration of specific VMs
Add the specific VMs to the
spec.cancelblock of theMigrationmanifest:Example YAML for canceling the migrations of two VMs
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- You can specify a VM by using the
idkey or thenamekey.
The value of the
idkey is the managed object reference, for a VMware VM, or the VM UUID, for a RHV VM.Retrieve the
MigrationCR to monitor the progress of the remaining VMs:oc get migration/<migration> -n <namespace> -o yaml
$ oc get migration/<migration> -n <namespace> -o yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow