Skip to content

Commit b4439a3

Browse files
authored
Merge pull request #29515 from apinnick/bz1929174-cnv-vm-import-access-modes
Updating CNV VM import to RHV (2.6.1)
2 parents d312e02 + 51ad88b commit b4439a3

File tree

2 files changed

+50
-61
lines changed

2 files changed

+50
-61
lines changed

modules/virt-importing-vm-cli.adoc

Lines changed: 32 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Optional: You can create a `ResourceMapping` CR that is separate from the `Virtu
1111

1212
[IMPORTANT]
1313
====
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.
1515
====
1616

1717
.Procedure
@@ -29,7 +29,7 @@ metadata:
2929
type: Opaque
3030
stringData:
3131
ovirt: |
32-
apiUrl: "https://<RHVM-FQDN>:8443/ovirt-engine/api" <2>
32+
apiUrl: <api_endpoint> <2>
3333
username: admin@internal
3434
password: <3>
3535
caCert: |
@@ -39,7 +39,7 @@ stringData:
3939
EOF
4040
----
4141
<1> Optional. You can specify a different namespace in all the CRs.
42-
<2> Specify the FQDN of the RHV Manager.
42+
<2> Specify the API endpoint of the RHV Manager, for example, `\"https://www.example.com:8443/ovirt-engine/api"`
4343
<3> Specify the password for `admin@internal`.
4444
<4> Specify the RHV Manager CA certificate. You can obtain the CA certificate by running the following command:
4545
+
@@ -48,70 +48,38 @@ EOF
4848
$ openssl s_client -connect :443 -showcerts < /dev/null
4949
----
5050

51-
. 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:
5252
+
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"]
8453
[source,yaml]
8554
----
8655
$ cat <<EOF | kubectl create -f -
8756
apiVersion: v2v.kubevirt.io/v1alpha1
8857
kind: ResourceMapping
8958
metadata:
90-
name: resourcemapping-example
59+
name: resourcemapping_example
9160
namespace: default
9261
spec:
9362
ovirt:
9463
networkMappings:
9564
- source:
96-
name: <rhv-logical-network>/<vnic-profile> <1>
65+
name: <rhv_logical_network>/<vnic_profile> <1>
9766
target:
98-
name: <target-network> <2>
67+
name: <target_network> <2>
9968
type: pod
10069
storageMappings: <3>
10170
- source:
102-
name: <rhv-storage-domain> <4>
71+
name: <rhv_storage_domain> <4>
10372
target:
104-
name: <target-storage-class> <5>
105-
volumeMode: <volume-mode> <6>
73+
name: <target_storage_class> <5>
74+
volumeMode: <volume_mode> <6>
10675
EOF
10776
----
10877
<1> Specify the RHV logical network and vNIC profile.
10978
<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.
11180
<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`.
11382
<6> If you specified the `ocs-storagecluster-ceph-rbd` storage class, you must specify `Block` as the volume mode.
114-
endif::[]
11583

11684
. Create the `VirtualMachineImport` CR by running the following command:
11785
+
@@ -130,47 +98,53 @@ spec:
13098
# resourceMapping: <1>
13199
# name: resourcemapping-example
132100
# namespace: default
133-
targetVmName: vm-example <2>
101+
targetVmName: vm_example <2>
134102
startVm: true
135103
source:
136104
ovirt:
137105
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>
140108
cluster:
141-
name: <source-cluster-name> <5>
109+
name: <source_cluster_name> <5>
142110
mappings: <6>
143111
networkMappings:
144112
- source:
145-
name: <source-logical-network>/<vnic-profile> <7>
113+
name: <source_logical_network>/<vnic_profile> <7>
146114
target:
147-
name: <target-network> <8>
115+
name: <target_network> <8>
148116
type: pod
149117
storageMappings: <9>
150118
- source:
151-
name: <source-storage-domain> <10>
119+
name: <source_storage_domain> <10>
152120
target:
153-
name: <target-storage-class> <11>
121+
name: <target_storage_class> <11>
122+
accessMode: <volume_access_mode> <12>
154123
diskMappings:
155124
- source:
156-
id: <source-vm-disk-id> <12>
125+
id: <source_vm_disk_id> <13>
157126
target:
158-
name: <target-storage-class> <13>
127+
name: <target_storage_class> <14>
159128
EOF
160129
----
161130
<1> If you create a `ResourceMapping` CR, uncomment the `resourceMapping` section.
162131
<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.
164133
<4> If you specify the source VM name, you must also specify the source cluster. Do not specify the source VM ID.
165134
<5> If you specify the source cluster, you must also specify the source VM name. Do not specify the source VM ID.
166135
<6> If you create a `ResourceMapping` CR, comment out the `mappings` section.
167136
<7> Specify the logical network and vNIC profile of the source VM.
168137
<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.
170139
<10> Specify the source storage domain.
171140
<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.
174148

175149
. Follow the progress of the virtual machine import to verify that the import was successful:
176150
+

modules/virt-storage-wizard-fields-web.adoc

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Module included in the following assemblies:
22
//
33
// * virt/virtual_machines/virt-create-vms.adoc
4-
// * virt/virtual_machines/importing_vms/virt-importing-vmware-vm.adoc
4+
// * virt/virtual_machines/importing_vms/virt-importing-rhv-vm.adoc
55
// * virt/vm_templates/virt-creating-vm-template.adoc
66

77
[id="virt-storage-wizard-fields-web_{context}"]
@@ -52,17 +52,20 @@
5252
|Advanced -> Volume Mode
5353
|
5454
|Defines whether the persistent volume uses a formatted file system or raw block state. Default is *Filesystem*.
55-
55+
ifeval::["{context}" != "virt-importing-rhv-vm"]
5656
|Advanced -> Access Mode
5757
|
5858
|Access mode of the persistent volume. Supported access modes are *Single User (RWO)*, *Shared Access (RWX)*, and *Read Only (ROX)*.
59-
59+
endif::[]
6060
|===
6161

6262
[id="virt-storage-wizard-fields-advanced-web_{context}"]
6363
[discrete]
6464
== Advanced storage settings
65+
66+
ifeval::["{context}" != "virt-importing-rhv-vm"]
6567
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::[]
6669

6770
[cols="2a,3a,5a"]
6871
|===
@@ -75,17 +78,29 @@ The following advanced storage settings are available for *Blank*, *Import via U
7578
|Block
7679
|Stores the virtual disk directly on the block volume. Only use `Block` if the underlying storage supports it.
7780

81+
ifeval::["{context}" == "virt-importing-rhv-vm"]
82+
.3+|Access Mode ^[1]^
83+
endif::[]
84+
ifeval::["{context}" != "virt-importing-rhv-vm"]
7885
.3+|Access Mode
86+
endif::[]
7987
|Single User (RWO)
8088
|The disk can be mounted as read/write by a single node.
8189

8290
|Shared Access (RWX)
8391
|The disk can be mounted as read/write by many nodes.
92+
ifeval::["{context}" != "virt-importing-rhv-vm"]
8493
[NOTE]
8594
====
8695
This is required for some features, such as live migration of virtual machines between nodes.
8796
====
97+
endif::[]
8898

8999
|Read Only (ROX)
90100
|The disk can be mounted as read-only by many nodes.
91101
|===
102+
ifeval::["{context}" == "virt-importing-rhv-vm"]
103+
--
104+
1. You can change the access mode by using the command line interface.
105+
--
106+
endif::[]

0 commit comments

Comments
 (0)