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-datavolume.adoc
+44-45Lines changed: 44 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,82 +4,79 @@
4
4
5
5
:_content-type: PROCEDURE
6
6
[id="virt-importing-vm-datavolume_{context}"]
7
-
= Importing a virtual machine image into a persistent volume claim by using a data volume
7
+
= Importing a virtual machine image into storage by using a data volume
8
8
9
-
You can import a virtual machine image into a persistent volume claim (PVC) by using a data volume.
9
+
You can import a virtual machine image into storage by using a data volume.
10
10
11
-
The virtual machine image can be hosted at an HTTP or HTTPS endpoint, or the image can be built into a container disk and stored in a container registry.
11
+
The virtual machine image can be hosted at an HTTP or HTTPS endpoint or the image can be built into a container disk and stored in a container registry.
12
12
13
-
To create a virtual machine from an imported virtual machine image, specify the image or container disk endpoint in the`VirtualMachine` configuration file before you create the virtual machine.
13
+
You specify the data source for the image in a`VirtualMachine` configuration file. When the virtual machine is created, the data volume with the virtual machine image is imported into storage.
14
14
15
15
.Prerequisites
16
16
17
-
* You have installed the OpenShift CLI (`oc`).
18
-
* Your cluster has at least one available persistent volume.
19
17
* To import a virtual machine image you must have the following:
20
-
** A virtual machine disk image in RAW, ISO, or QCOW2 format, optionally
21
-
compressed by using `xz` or `gz`.
22
-
** An HTTP endpoint where the image is hosted, along with any authentication
23
-
credentials needed to access the data source. For example: `http://www.example.com/path/to/data`
24
-
* To import a container disk you must have the following:
25
-
** A container disk built from a virtual machine image stored in your container image registry, along with any authentication credentials needed to access the data source. For example: `docker://registry.example.com/container-image`
18
+
** A virtual machine disk image in RAW, ISO, or QCOW2 format, optionally compressed by using `xz` or `gz`.
19
+
** An HTTP or HTTPS endpoint where the image is hosted, along with any authentication credentials needed to access the data source.
20
+
* To import a container disk, you must have a virtual machine image built into a container disk and stored in a container registry, along with any authentication credentials needed to access the data source.
21
+
* If the virtual machine must communicate with servers that use self-signed certificates or certificates not signed by the system CA bundle, you must create a config map in the same namespace as the data volume.
26
22
27
23
.Procedure
28
24
29
-
. Optional: If your data source requires authentication credentials, edit the
30
-
`endpoint-secret.yaml` file, and apply the updated configuration to the cluster:
25
+
. If your data source requires authentication, create a `Secret` manifest, specifying the data source credentials, and save it as `endpoint-secret.yaml`:
31
26
+
32
27
[source,yaml]
33
28
----
34
29
apiVersion: v1
35
30
kind: Secret
36
31
metadata:
37
-
name: <endpoint-secret>
32
+
name: endpoint-secret <1>
38
33
labels:
39
34
app: containerized-data-importer
40
35
type: Opaque
41
36
data:
42
-
accessKeyId: "" <1>
43
-
secretKey: "" <2>
37
+
accessKeyId: "" <2>
38
+
secretKey: "" <3>
44
39
----
45
-
<1> Optional: your key or user name, base64 encoded
46
-
<2> Optional: your secret or password, base64 encoded
40
+
<1> Specify the name of the `Secret`.
41
+
<2> Specify the Base64-encoded key ID or user name.
42
+
<3> Specify the Base64-encoded secret key or password.
43
+
44
+
. Apply the `Secret` manifest:
47
45
+
48
46
[source,terminal]
49
47
----
50
48
$ oc apply -f endpoint-secret.yaml
51
49
----
52
50
53
-
. Edit the virtual machine configuration file, specifying the data source for
54
-
the virtual machine image you want to import. In this example, a Fedora image is imported from an `http` source:
51
+
. Edit the `VirtualMachine` manifest, specifying the data source for the virtual machine image you want to import, and save it as `vm-fedora-datavolume.yaml`:
<1> The source type to import the image from. This example uses an HTTP endpoint. To import a container disk from a registry, replace `http` with `registry`.
110
-
<2> The source of the virtual machine image you want to import. This example references a virtual machine image at an HTTP endpoint. An example of a container registry endpoint is `url: "docker://kubevirt/fedora-cloud-container-disk-demo:latest"`.
111
-
<3> The `secretRef` parameter is optional.
112
-
<4> The `certConfigMap` is required for communicating with servers that use self-signed certificates or certificates not signed by the system CA bundle. The referenced config map must be in the same namespace as the data volume.
113
-
<5> Specify `type: dataVolume` or `type: ""`. If you specify any other value for `type`, such as `persistentVolumeClaim`, a warning is displayed, and the virtual machine does not start.
106
+
<1> Specify the name of the virtual machine.
107
+
<2> Specify the name of the data volume.
108
+
<3> Specify `http` for an HTTP or HTTPS endpoint. Specify `registry` for a container disk image imported from a registry.
109
+
<4> The source of the virtual machine image you want to import. This example references a virtual machine image at an HTTPS endpoint. An example of a container registry endpoint is `url: "docker://kubevirt/fedora-cloud-container-disk-demo:latest"`.
110
+
<5> Required if you created a `Secret` for the data source.
111
+
<6> Optional: Specify a CA certificate config map.
112
+
====
114
113
115
114
. Create the virtual machine:
116
115
+
117
116
[source,terminal]
118
117
----
119
-
$ oc create -f vm-<name>-datavolume.yaml
118
+
$ oc create -f vm-fedora-datavolume.yaml
120
119
----
121
120
+
122
121
[NOTE]
123
122
====
124
-
The `oc create` command creates the data volume and the virtual machine. The CDI controller creates an underlying PVC with the correct annotation, and the import process begins. When the import completes, the data volume status changes to `Succeeded`, and the virtual machine is allowed to start.
123
+
The `oc create` command creates the data volume and the virtual machine. The CDI controller creates an underlying PVC with the correct annotation and the import process begins. When the import is complete, the data volume status changes to `Succeeded`. You can start the virtual machine.
125
124
126
-
Data volume provisioning happens in the background, so there is no need to monitor it. You can start the virtual machine, and it will not run until the import is complete.
125
+
Data volume provisioning happens in the background, so there is no need to monitor the process.
127
126
====
128
127
129
128
.Verification
129
+
130
130
. The importer pod downloads the virtual machine image or container disk from the specified URL and stores it on the provisioned PV. View the status of the importer pod by running the following command:
131
131
+
132
132
[source,terminal]
133
133
----
134
134
$ oc get pods
135
135
----
136
136
137
-
. Monitor the data volume status until it shows`Succeeded` by running the following command:
137
+
. Monitor the data volume until its status is`Succeeded` by running the following command:
138
138
+
139
139
[source,terminal]
140
140
----
141
-
$ oc describe dv <datavolume-name> <1>
141
+
$ oc describe dv fedora-dv <1>
142
142
----
143
-
<1> The name of the data volume as specified under `dataVolumeTemplates.metadata.name` in the virtual machine
144
-
configuration file. In the example configuration above, this is `fedora-dv`.
143
+
<1> Specify the data volume name that you defined in the `VirtualMachine` manifest.
145
144
146
-
. To verify that provisioning is complete and that the VMI has started, try accessing its serial console by running the following command:
145
+
. Verify that provisioning is complete and that the virtual machine has started by accessing its serial console:
Copy file name to clipboardExpand all lines: modules/virt-importing-vm-to-block-pv.adoc
+26-30Lines changed: 26 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,78 +4,74 @@
4
4
5
5
:_content-type: PROCEDURE
6
6
[id="virt-importing-vm-to-block-pv_{context}"]
7
-
= Importing a virtual machine image to a block persistent volume using data volumes
7
+
= Importing a virtual machine image into block storage by using a data volume
8
8
9
-
You can import an existing virtual machine image into your {product-title} cluster. {VirtProductName} uses data volumes to automate the importing data and the creation of an underlying persistent volume claim (PVC). You can then reference the data volume in a virtual machine manifest.
9
+
You can import a virtual machine image into block storage by using a data volume. You reference the data volume in a `VirtualMachine` manifest before you create a virtual machine.
10
10
11
11
.Prerequisites
12
12
13
-
* A virtual machine disk image, in RAW, ISO, or QCOW2 format, optionally compressed by using `xz` or `gz`.
14
-
* An `HTTP` or `s3` endpoint where the image is hosted, along with any authentication credentials needed to access the data source
15
-
* At least one available block PV.
13
+
* A virtual machine disk image in RAW, ISO, or QCOW2 format, optionally compressed by using `xz` or `gz`.
14
+
* An HTTP or HTTPS endpoint where the image is hosted, along with any authentication credentials needed to access the data source.
16
15
17
16
.Procedure
18
17
19
-
. If your data source requires authentication credentials, edit the `endpoint-secret.yaml` file, and apply the updated configuration to the cluster.
20
-
21
-
.. Edit the `endpoint-secret.yaml` file with your preferred text editor:
18
+
. If your data source requires authentication, create a `Secret` manifest, specifying the data source credentials, and save it as `endpoint-secret.yaml`:
22
19
+
23
20
[source,yaml]
24
21
----
25
22
apiVersion: v1
26
23
kind: Secret
27
24
metadata:
28
-
name: <endpoint-secret>
25
+
name: endpoint-secret <1>
29
26
labels:
30
27
app: containerized-data-importer
31
28
type: Opaque
32
29
data:
33
-
accessKeyId: "" <1>
34
-
secretKey: "" <2>
30
+
accessKeyId: "" <2>
31
+
secretKey: "" <3>
35
32
----
36
-
<1> Optional: your key or user name, base64 encoded
37
-
<2> Optional: your secret or password, base64 encoded
33
+
<1> Specify the name of the `Secret`.
34
+
<2> Specify the Base64-encoded key ID or user name.
35
+
<3> Specify the Base64-encoded secret key or password.
38
36
39
-
.. Update the secret by running the following command:
37
+
. Apply the `Secret` manifest:
40
38
+
41
39
[source,terminal]
42
40
----
43
41
$ oc apply -f endpoint-secret.yaml
44
42
----
45
43
46
-
. Create a `DataVolume` manifest that specifies the data source for the image you want to import and `volumeMode: Block`so that an available block PV is used.
44
+
. Create a `DataVolume` manifest, specifying the data source for the virtual machine image and `Block`for `storage.volumeMode`.
Copy file name to clipboardExpand all lines: modules/virt-template-fields-for-boot-source.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ The following table describes the fields for *Add boot source to template* windo
15
15
|Upload a file from your local device. Supported file types include gz, xz, tar, and qcow2.
16
16
17
17
|Import via URL (creates PVC)
18
-
|Import content from an image available from an HTTP or S3 endpoint. Obtain the download link URL from the web page where the image download is available and enter that URL link in the *Import via URL (creates PVC)* field. Example: For a Red Hat Enterprise Linux image, log on to the Red Hat Customer Portal, access the image download page, and copy the download link URL for the KVM guest image.
18
+
|Import content from an image available from an HTTP or HTTPS endpoint. Obtain the download link URL from the web page where the image download is available and enter that URL link in the *Import via URL (creates PVC)* field. Example: For a Red Hat Enterprise Linux image, log on to the Red Hat Customer Portal, access the image download page, and copy the download link URL for the KVM guest image.
19
19
20
20
|Clone existing PVC (creates PVC)
21
21
|Use a PVC that is already available in the cluster and clone it.
Copy file name to clipboardExpand all lines: modules/virt-vm-wizard-fields-web.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ endif::[]
57
57
58
58
.4+|Boot Source
59
59
|Import via URL (creates PVC)
60
-
|Import content from an image available from an *HTTP* or *S3* endpoint. Example: Obtaining a URL link from the web page with the operating system image.
60
+
|Import content from an image available from an HTTP or HTTPS endpoint. Example: Obtaining a URL link from the web page with the operating system image.
61
61
62
62
|Clone existing PVC (creates PVC)
63
63
|Select an existent persistent volume claim available on the cluster and clone it.
0 commit comments