$ kubectl create rolebinding <role_binding_name> \
--clusterrole=migrations.kubevirt.io:storagemigrate \
--user=<user_name> -n <namespace>
You can migrate one or more virtual disks to a different storage class to optimize storage performance or reduce costs without stopping your virtual machine (VM) or virtual machine instance (VMI).
cluster administrators must grant users permission to perform storage migrations. Permissions to perform storage migrations are not part of the administrative or editing roles in the cluster by default.
You have cluster administrator privileges.
(Optional) To assign the user single namespace storage migration permissions, run the following command:
$ kubectl create rolebinding <role_binding_name> \
--clusterrole=migrations.kubevirt.io:storagemigrate \
--user=<user_name> -n <namespace>
where:
The name to assign to this role binding instance.
The user to assign the storage migration permission.
The applicable namespace for this role binding instance.
(Optional) To assign the user multiple namespace storage migration permissions, run the following command:
$ kubectl create clusterrolebinding <role_binding_name> \
--clusterrole=migrations.kubevirt.io:storagemigrate-multins \
--user=<user_name>
where:
The name to assign to this role binding instance.
The user to assign the storage migration permission.
You can migrate one or more disks attached to a virtual machine (VM) to a different storage class by using the OKD web console. When performing this action on a running VM, the operation of the VM is not interrupted and the data on the migrated disks remains accessible.
You must have a data volume or a persistent volume claim (PVC) available for storage class migration.
The cluster must have a node available for live migration. As part of the storage class migration, the VM is live migrated to a different node.
The VM must be running.
Navigate to Virtualization → VirtualMachines in the web console.
Click the Options menu beside the virtual machine and select Migration → Storage.
You can also access this option from the VirtualMachine details page by selecting Actions → Migration → Storage.
Alternatively, right-click the VM in the tree view and select Migration from the menu.
On the Migration details page, choose whether to migrate the entire VM storage or selected volumes only. If you click Selected volumes, select any disks that you intend to migrate. Click Next to proceed.
From the list of available options on the Destination StorageClass page, select the storage class to migrate to. Click Next to proceed.
On the Review page, review the list of affected disks and the target storage class. To start the migration, click Migrate VirtualMachine storage.
Stay on the Migrate VirtualMachine storage page to watch the progress and wait for the confirmation that the migration completed successfully.
From the VirtualMachine details page, navigate to Configuration → Storage.
Verify that all disks have the expected storage class listed in the Storage class column.