You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/virt-importing-vm-cli.adoc
+32-58Lines changed: 32 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Optional: You can create a `ResourceMapping` CR that is separate from the `Virtu
11
11
12
12
[IMPORTANT]
13
13
====
14
-
The default target storage class must be NFS. Cinder does not support RHV VM import. See link:https://bugzilla.redhat.com/show_bug.cgi?id=1856439[(*BZ#1856439*)].
14
+
The default target storage class must be NFS. Cinder does not support RHV VM import.
. Optional: Create the `ResourceMapping` CR if you want to separate the resource mapping from the `VirtualMachineImport` CR by running the following command:
51
+
. Optional: Create a `ResourceMapping` CR if you want to separate the resource mapping from the `VirtualMachineImport` CR by running the following command:
52
52
+
53
-
ifeval::["{VirtVersion}" < "2.5"]
54
-
[source,yaml]
55
-
----
56
-
$ cat <<EOF | kubectl create -f -
57
-
apiVersion: v2v.kubevirt.io/v1beta1
58
-
kind: ResourceMapping
59
-
metadata:
60
-
name: resourcemapping-example
61
-
namespace: default
62
-
spec:
63
-
ovirt:
64
-
networkMappings:
65
-
- source:
66
-
name: <rhv-logical-network>/<vnic-profile> <1>
67
-
target:
68
-
name: <target-network> <2>
69
-
type: pod
70
-
storageMappings: <3>
71
-
- source:
72
-
name: <rhv-storage-domain> <4>
73
-
target:
74
-
name: <target-storage-class> <5>
75
-
EOF
76
-
----
77
-
<1> Specify the RHV logical network and vNIC profile.
78
-
<2> Specify the {VirtProductName} network.
79
-
<3> If `storageMappings` are specified in both the `ResourceMapping` and the `VirtualMachineImport` CRs, the `VirtualMachineImport` CR takes precedence.
80
-
<4> Specify the RHV storage domain.
81
-
<5> The default storage class must be `nfs`.
82
-
endif::[]
83
-
ifeval::["{VirtVersion}" >= "2.5"]
84
53
[source,yaml]
85
54
----
86
55
$ cat <<EOF | kubectl create -f -
87
56
apiVersion: v2v.kubevirt.io/v1alpha1
88
57
kind: ResourceMapping
89
58
metadata:
90
-
name: resourcemapping-example
59
+
name: resourcemapping_example
91
60
namespace: default
92
61
spec:
93
62
ovirt:
94
63
networkMappings:
95
64
- source:
96
-
name: <rhv-logical-network>/<vnic-profile> <1>
65
+
name: <rhv_logical_network>/<vnic_profile> <1>
97
66
target:
98
-
name: <target-network> <2>
67
+
name: <target_network> <2>
99
68
type: pod
100
69
storageMappings: <3>
101
70
- source:
102
-
name: <rhv-storage-domain> <4>
71
+
name: <rhv_storage_domain> <4>
103
72
target:
104
-
name: <target-storage-class> <5>
105
-
volumeMode: <volume-mode> <6>
73
+
name: <target_storage_class> <5>
74
+
volumeMode: <volume_mode> <6>
106
75
EOF
107
76
----
108
77
<1> Specify the RHV logical network and vNIC profile.
109
78
<2> Specify the {VirtProductName} network.
110
-
<3> If `storageMappings` are specified in both the `ResourceMapping` and the `VirtualMachineImport` CRs, the `VirtualMachineImport` CR takes precedence.
79
+
<3> If storage mappings are specified in both the `ResourceMapping` and the `VirtualMachineImport` CRs, the `VirtualMachineImport` CR takes precedence.
111
80
<4> Specify the RHV storage domain.
112
-
<5> Specify the target storage class as `nfs` or `ocs-storagecluster-ceph-rbd`.
81
+
<5> Specify `nfs` or `ocs-storagecluster-ceph-rbd`.
113
82
<6> If you specified the `ocs-storagecluster-ceph-rbd` storage class, you must specify `Block` as the volume mode.
114
-
endif::[]
115
83
116
84
. Create the `VirtualMachineImport` CR by running the following command:
117
85
+
@@ -130,47 +98,53 @@ spec:
130
98
# resourceMapping: <1>
131
99
# name: resourcemapping-example
132
100
# namespace: default
133
-
targetVmName: vm-example <2>
101
+
targetVmName: vm_example <2>
134
102
startVm: true
135
103
source:
136
104
ovirt:
137
105
vm:
138
-
id: <source-vm-id> <3>
139
-
name: <source-vm-name> <4>
106
+
id: <source_vm_id> <3>
107
+
name: <source_vm_name> <4>
140
108
cluster:
141
-
name: <source-cluster-name> <5>
109
+
name: <source_cluster_name> <5>
142
110
mappings: <6>
143
111
networkMappings:
144
112
- source:
145
-
name: <source-logical-network>/<vnic-profile> <7>
113
+
name: <source_logical_network>/<vnic_profile> <7>
146
114
target:
147
-
name: <target-network> <8>
115
+
name: <target_network> <8>
148
116
type: pod
149
117
storageMappings: <9>
150
118
- source:
151
-
name: <source-storage-domain> <10>
119
+
name: <source_storage_domain> <10>
152
120
target:
153
-
name: <target-storage-class> <11>
121
+
name: <target_storage_class> <11>
122
+
accessMode: <volume_access_mode> <12>
154
123
diskMappings:
155
124
- source:
156
-
id: <source-vm-disk-id> <12>
125
+
id: <source_vm_disk_id> <13>
157
126
target:
158
-
name: <target-storage-class> <13>
127
+
name: <target_storage_class> <14>
159
128
EOF
160
129
----
161
130
<1> If you create a `ResourceMapping` CR, uncomment the `resourceMapping` section.
162
131
<2> Specify the target VM name.
163
-
<3> Specify the source VM ID, for example, `80554327-0569-496b-bdeb-fcbbf52b827b`. You can obtain the VM ID by entering `\https://<RHV_Manager_FQDN>/ovirt-engine/api/vms/` in a web browser on the Manager machine to list all VMs. Locate the VM you want to import and its corresponding VM ID. You do not need to specify a VM name or cluster name.
132
+
<3> Specify the source VM ID, for example, `80554327-0569-496b-bdeb-fcbbf52b827b`. You can obtain the VM ID by entering `\https://www.example.com/ovirt-engine/api/vms/` in a web browser on the Manager machine to list all VMs. Locate the VM you want to import and its corresponding VM ID. You do not need to specify a VM name or cluster name.
164
133
<4> If you specify the source VM name, you must also specify the source cluster. Do not specify the source VM ID.
165
134
<5> If you specify the source cluster, you must also specify the source VM name. Do not specify the source VM ID.
166
135
<6> If you create a `ResourceMapping` CR, comment out the `mappings` section.
167
136
<7> Specify the logical network and vNIC profile of the source VM.
168
137
<8> Specify the {VirtProductName} network.
169
-
<9> If `storageMappings` are specified in both the `ResourceMapping` and the `VirtualMachineImport` CRs, the `VirtualMachineImport` CR takes precedence.
138
+
<9> If storage mappings are specified in both the `ResourceMapping` and the `VirtualMachineImport` CRs, the `VirtualMachineImport` CR takes precedence.
170
139
<10> Specify the source storage domain.
171
140
<11> Specify the target storage class.
172
-
<12> Specify the source VM disk ID, for example, `8181ecc1-5db8-4193-9c92-3ddab3be7b05`. You can obtain the disk ID by entering `\https://<RHV_Manager_FQDN>/ovirt-engine/api/vms/<VM_ID>` in a web browser on the Manager machine and reviewing the VM details.
173
-
<13> Specify the target storage class.
141
+
<12> Specify `ReadWriteOnce`, `ReadWriteMany`, or `ReadOnlyMany`. If no access mode is specified, {virt} determines the correct volume access mode based on the *Host* -> *Migration mode* setting of the RHV VM or on the virtual disk access mode:
142
+
* If the RHV VM migration mode is `Allow manual and automatic migration`, the default access mode is `ReadWriteMany`.
143
+
* If the RHV virtual disk access mode is `ReadOnly`, the default access mode is `ReadOnlyMany`.
144
+
* For all other settings, the default access mode is `ReadWriteOnce`.
145
+
146
+
<13> Specify the source VM disk ID, for example, `8181ecc1-5db8-4193-9c92-3ddab3be7b05`. You can obtain the disk ID by entering `\https://www.example.com/ovirt-engine/api/vms/vm23` in a web browser on the Manager machine and reviewing the VM details.
147
+
<14> Specify the target storage class.
174
148
175
149
. Follow the progress of the virtual machine import to verify that the import was successful:
The following advanced storage settings are available for *Blank*, *Import via URL*, and *Clone existing PVC* disks. These parameters are optional. If you do not specify these parameters, the system uses the default values from the `kubevirt-storage-class-defaults` config map.
68
+
endif::[]
66
69
67
70
[cols="2a,3a,5a"]
68
71
|===
@@ -75,17 +78,29 @@ The following advanced storage settings are available for *Blank*, *Import via U
75
78
|Block
76
79
|Stores the virtual disk directly on the block volume. Only use `Block` if the underlying storage supports it.
77
80
81
+
ifeval::["{context}" == "virt-importing-rhv-vm"]
82
+
.3+|Access Mode ^[1]^
83
+
endif::[]
84
+
ifeval::["{context}" != "virt-importing-rhv-vm"]
78
85
.3+|Access Mode
86
+
endif::[]
79
87
|Single User (RWO)
80
88
|The disk can be mounted as read/write by a single node.
81
89
82
90
|Shared Access (RWX)
83
91
|The disk can be mounted as read/write by many nodes.
92
+
ifeval::["{context}" != "virt-importing-rhv-vm"]
84
93
[NOTE]
85
94
====
86
95
This is required for some features, such as live migration of virtual machines between nodes.
87
96
====
97
+
endif::[]
88
98
89
99
|Read Only (ROX)
90
100
|The disk can be mounted as read-only by many nodes.
91
101
|===
102
+
ifeval::["{context}" == "virt-importing-rhv-vm"]
103
+
--
104
+
1. You can change the access mode by using the command line interface.
0 commit comments