From d06fb2c9ff2c49ceaf846e20b6dcf96f3b59db8e Mon Sep 17 00:00:00 2001 From: Pan Ousley Date: Thu, 10 Sep 2020 21:31:25 -0400 Subject: [PATCH] CNV-5078: image-upload in the web console --- _topic_map.yml | 2 + .../virt-cdi-supported-operations-matrix.adoc | 2 +- modules/virt-uploading-image-web.adoc | 57 +++++++++++++++++++ .../virt-uploading-local-disk-image-dv.adoc | 19 ++++++- .../virt-uploading-local-disk-image-pvc.adoc | 23 ++++++-- .../virt-uploading-local-disk-images-web.adoc | 21 +++++++ 6 files changed, 117 insertions(+), 7 deletions(-) create mode 100644 modules/virt-uploading-image-web.adoc create mode 100644 virt/virtual_machines/virtual_disks/virt-uploading-local-disk-images-web.adoc diff --git a/_topic_map.yml b/_topic_map.yml index 63371a781e..998fe29632 100644 --- a/_topic_map.yml +++ b/_topic_map.yml @@ -2252,6 +2252,8 @@ Topics: File: virt-configuring-local-storage-for-vms - Name: Configuring CDI to work with namespaces that have a compute resource quota File: virt-configuring-cdi-for-namespace-resourcequota + - Name: Uploading local disk images by using the web console + File: virt-uploading-local-disk-images-web - Name: Uploading local disk images by using the virtctl tool File: virt-uploading-local-disk-images-virtctl - Name: Uploading a local disk image to a block storage DataVolume diff --git a/modules/virt-cdi-supported-operations-matrix.adoc b/modules/virt-cdi-supported-operations-matrix.adoc index 24ddfa2e68..d2fd00fb6e 100644 --- a/modules/virt-cdi-supported-operations-matrix.adoc +++ b/modules/virt-cdi-supported-operations-matrix.adoc @@ -8,7 +8,7 @@ // * virt/virtual_machines/cloning_vms/virt-cloning-vm-disk-into-new-datavolume-block.adoc // * virt/virtual_machines/importing_vms/virt-importing-virtual-machine-images-datavolumes.adoc // * virt/virtual_machines/importing_vms/virt-importing-virtual-machine-images-datavolumes-block.adoc - +// * virt/virtual_machines/virtual_disks/virt-uploading-local-disk-images-web.adoc [id="virt-cdi-supported-operations-matrix_{context}"] = CDI supported operations matrix diff --git a/modules/virt-uploading-image-web.adoc b/modules/virt-uploading-image-web.adoc new file mode 100644 index 0000000000..57d0cc9bcc --- /dev/null +++ b/modules/virt-uploading-image-web.adoc @@ -0,0 +1,57 @@ +// Module included in the following assemblies: +// +// * virt/virtual_machines/virtual_disks/virt-uploading-local-disk-images-web.adoc + +[id="virt-uploading-image-web_{context}"] += Uploading an image file using the web console + +Use the web console to upload an image file to a new Persistent Volume Claim (PVC). +You can later use this PVC to attach the image to new virtual machines. + +.Prerequisites + +* You must have one of the following: +** A raw virtual machine image file in either ISO or IMG format. +** A virtual machine image file in QCOW2 format. +* For best results, compress your image file according to the following guidelines before you upload it: +** Compress a raw image file by using `xz` or `gzip`. ++ +[NOTE] +==== +Using a compressed raw image file results in the most efficient upload. +==== +** Compress a QCOW2 image file by using the method that is recommended for your client: +*** If you use a Linux client, _sparsify_ the QCOW2 file by using the +link:https://libguestfs.org/virt-sparsify.1.html[virt-sparsify] tool. +*** If you use a Windows client, compress the QCOW2 file by using `xz` or `gzip`. + +.Procedure + +. From the side menu of the web console, click *Storage* -> *Persistent Volume Claims*. + +. Click the *Create Persistent Volume Claim* drop-down list to expand it. + +. Click *With Data Upload Form* to open the *Upload Data to Persistent Volume Claim* page. + +. Click *Browse* to open the file manager and select the image that you want to upload, or drag the file into the *Drag a file here or browse to upload* field. + +. Optional: Set this image as the default image for a specific operating system. + +.. Select the *Attach this data to a virtual machine operating system* check box. + +.. Select an operating system from the list. + +. The *Persistent Volume Claim Name* field is automatically filled with a unique name and cannot be edited. Take note of the name assigned to the PVC so that you can identify it later, if necessary. + +. Select a storage class from the *Storage Class* list. + +. In the *Size* field, enter the size value for the PVC. Select the corresponding unit of measurement from the drop-down list. ++ +[WARNING] +==== +The PVC size must be larger than the size of the image file. +==== + +. Select an *Access Mode* that matches the storage class that you selected. + +. Click *Upload*. diff --git a/modules/virt-uploading-local-disk-image-dv.adoc b/modules/virt-uploading-local-disk-image-dv.adoc index 06d19cbd7c..8b1736ad38 100644 --- a/modules/virt-uploading-local-disk-image-dv.adoc +++ b/modules/virt-uploading-local-disk-image-dv.adoc @@ -16,9 +16,24 @@ After you upload a local disk image, you can add it to a virtual machine. .Prerequisites -* A virtual machine disk image, in RAW, ISO, or QCOW2 format, optionally -compressed by using `xz` or `gz`. +* You must have one of the following: +** A raw virtual machine image file in either ISO or IMG format. +** A virtual machine image file in QCOW2 format. + +* For best results, compress your image file according to the following guidelines before you upload it: +** Compress a raw image file by using `xz` or `gzip`. ++ +[NOTE] +==== +Using a compressed raw image file results in the most efficient upload. +==== +** Compress a QCOW2 image file by using the method that is recommended for your client: +*** If you use a Linux client, _sparsify_ the QCOW2 file by using the +link:https://libguestfs.org/virt-sparsify.1.html[virt-sparsify] tool. +*** If you use a Windows client, compress the QCOW2 file by using `xz` or `gzip`. + * The `kubevirt-virtctl` package must be installed on the client machine. + * The client machine must be configured to trust the {product-title} router's certificate. diff --git a/modules/virt-uploading-local-disk-image-pvc.adoc b/modules/virt-uploading-local-disk-image-pvc.adoc index 64fcae6085..005f329b1d 100644 --- a/modules/virt-uploading-local-disk-image-pvc.adoc +++ b/modules/virt-uploading-local-disk-image-pvc.adoc @@ -11,17 +11,32 @@ PersistentVolumeClaim (PVC) that you can associate with a virtual machine. .Prerequisites -* A virtual machine disk image, in RAW, ISO, or QCOW2 format, optionally -compressed by using `xz` or `gz`. +* You must have one of the following: +** A raw virtual machine image file in either ISO or IMG format. +** A virtual machine image file in QCOW2 format. + +* For best results, compress your image file according to the following guidelines before you upload it: +** Compress a raw image file by using `xz` or `gzip`. ++ +[NOTE] +==== +Using a compressed raw image file results in the most efficient upload. +==== +** Compress a QCOW2 image file by using the method that is recommended for your client: +*** If you use a Linux client, _sparsify_ the QCOW2 file by using the +link:https://libguestfs.org/virt-sparsify.1.html[virt-sparsify] tool. +*** If you use a Windows client, compress the QCOW2 file by using `xz` or `gzip`. + * The `kubevirt-virtctl` package must be installed on the client machine. + * The client machine must be configured to trust the {product-title} router's certificate. .Procedure . Identify the following items: -* File location of the VM disk image you want to upload -* Name and size required for the resulting PVC +* File location of the VM disk image you want to upload. +* Name and size required for the resulting PVC. . Run the `virtctl image-upload` command to upload your VM image. You must specify the PVC name, PVC size, and file location. For example: diff --git a/virt/virtual_machines/virtual_disks/virt-uploading-local-disk-images-web.adoc b/virt/virtual_machines/virtual_disks/virt-uploading-local-disk-images-web.adoc new file mode 100644 index 0000000000..2fe7eba0a8 --- /dev/null +++ b/virt/virtual_machines/virtual_disks/virt-uploading-local-disk-images-web.adoc @@ -0,0 +1,21 @@ +[id="virt-uploading-local-disk-images-web"] += Uploading local disk images by using the web console +include::modules/virt-document-attributes.adoc[] +:context: virt-uploading-local-disk-images-web +toc::[] + +You can upload a locally stored disk image file by using the web console. + +== Prerequisites + +* You must have a virtual machine image file in IMG, ISO, or QCOW2 format. + +* If you require scratch space according to the +xref:../../../virt/virtual_machines/virtual_disks/virt-uploading-local-disk-images-web.adoc#virt-cdi-supported-operations-matrix_virt-uploading-local-disk-images-web[CDI supported operations matrix], you must first +xref:../../../virt/virtual_machines/virtual_disks/virt-preparing-cdi-scratch-space.adoc#virt-defining-storageclass-in-cdi-configuration_virt-preparing-cdi-scratch-space[define a StorageClass or prepare CDI scratch space] +for this operation to complete successfully. + +include::modules/virt-cdi-supported-operations-matrix.adoc[leveloffset=+1] + +include::modules/virt-uploading-image-web.adoc[leveloffset=+1] +