1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00

CNV-15757: Data volume garbage collection

This commit is contained in:
Bob Gaydos
2022-11-10 18:04:12 -05:00
committed by openshift-cherrypick-robot
parent ee893d17cb
commit db625ec66a
10 changed files with 27 additions and 84 deletions

View File

@@ -3625,8 +3625,6 @@ Topics:
File: virt-reusing-statically-provisioned-persistent-volumes
- Name: Expanding a virtual machine disk
File: virt-expanding-vm-disk
- Name: Deleting data volumes
File: virt-deleting-datavolumes
# Templates
- Name: Virtual machine templates
Dir: vm_templates

View File

@@ -1,5 +1,7 @@
// Module included in the following assemblies:
//
// * virt/virtual_machines/virtual_disks/virt-creating-data-volumes.adoc
// * virt/virtual_machines/virtual_disks/virt-cloning-a-datavolume-using-smart-cloning.adoc
// * virt/virtual_machines/virtual_disks/virt-expanding-virtual-storage-with-blank-disk-images.adoc
// * virt/virtual_machines/virtual_disks/virt-uploading-local-disk-images-block.adoc
// * virt/virtual_machines/virtual_disks/virt-preparing-cdi-scratch-space.adoc
@@ -10,12 +12,16 @@
// * 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
:_content-type: CONCEPT
[id="virt-about-datavolumes_{context}"]
= About data volumes
`DataVolume` objects are custom resources that are provided by the Containerized
Data Importer (CDI) project. Data volumes orchestrate import, clone, and upload
operations that are associated with an underlying persistent volume claim (PVC).
Data volumes are integrated with {VirtProductName}, and they prevent a virtual machine
from being started before the PVC has been prepared.
`DataVolume` objects are custom resources that are provided by the Containerized Data Importer (CDI) project. Data volumes orchestrate import, clone, and upload operations that are associated with an underlying persistent volume claim (PVC). You can create a data volume as either a standalone resource or by using the `dataVolumeTemplate` field in the virtual machine (VM) specification.
[NOTE]
====
* VM disk PVCs that are prepared by using standalone data volumes maintain an independent lifecycle from the VM. If you use the `dataVolumeTemplate` field in the VM specification to prepare the PVC, the PVC shares the same lifecycle as the VM.
====
After a PVC is populated, the data volume that you used to create the PVC is no longer needed. {VirtProductName} enables automatic garbage collection of completed data volumes by default. Standalone data volumes, and data volumes created by using the `dataVolumeTemplate` resource, are automatically garbage collected after completion.

View File

@@ -1,30 +0,0 @@
// Module included in the following assemblies:
//
// * virt/virtual_machines/virt-deleting-datavolumes.adoc
:_content-type: PROCEDURE
[id="virt-deleting-dvs_{context}"]
= Deleting a data volume
You can delete a data volume by using the `oc` command-line interface (CLI).
.Prerequisites
* Identify the name of the data volume that you want to delete.
.Procedure
* Delete the data volume by running the following command:
+
[source,terminal]
----
$ oc delete dv <datavolume_name>
----
+
[NOTE]
====
This command only deletes objects that exist in the current project. Specify the
`-n <project_name>` option if the object you want to delete is in
a different project or namespace.
====

View File

@@ -6,14 +6,13 @@
[id="virt-deleting-virt-cli_{context}"]
= Uninstalling {VirtProductName} by using the CLI
You can uninstall {VirtProductName} by using the xref:../../cli_reference/openshift_cli/getting-started-cli.adoc#cli-getting-started[command line interface (CLI)].
You can uninstall {VirtProductName} by using the OpenShift CLI (`oc`).
.Prerequisites
* You have access to an {product-title} cluster using an account with `cluster-admin` permissions.
* You have installed the OpenShift CLI (oc).
* You have deleted all xref:../../virt/virtual_machines/virt-delete-vms.adoc#virt-delete-vm-web_virt-delete-vms[virtual machines], xref:../../virt/virtual_machines/virt-manage-vmis.adoc#virt-deleting-vmis-cli_virt-manage-vmis[virtual machine instances],
and xref:../../virt/virtual_machines/virtual_disks/virt-deleting-datavolumes.adoc#virt-deleting-dvs_virt-deleting-datavolumes[data volumes]. You cannot uninstall {VirtProductName} while its workloads remain on the cluster.
* You have installed the OpenShift CLI (`oc`).
* You have deleted all virtual machines and virtual machine instances. You cannot uninstall {VirtProductName} while its workloads remain on the cluster.
.Procedure
@@ -61,4 +60,4 @@ customresourcedefinition.apiextensions.k8s.io "tektontasks.tektontasks.kubevirt.
[source,terminal]
----
$ oc delete crd -l operators.coreos.com/kubevirt-hyperconverged.openshift-cnv
----
----

View File

@@ -1,19 +0,0 @@
// Module included in the following assemblies:
//
// * virt/virtual_machines/virt-deleting-datavolumes.adoc
:_content-type: PROCEDURE
[id="virt-listing-dvs_{context}"]
= Listing all data volumes
You can list the data volumes in your cluster by using the `oc` command-line interface.
.Procedure
* List all data volumes by running the following command:
+
[source,terminal]
----
$ oc get dvs
----

View File

@@ -20,8 +20,7 @@ You uninstall {VirtProductName} by using the xref:../../web_console/web-console.
[IMPORTANT]
====
You must first delete all xref:../../virt/virtual_machines/virt-delete-vms.adoc#virt-delete-vm-web_virt-delete-vms[virtual machines], xref:../../virt/virtual_machines/virt-manage-vmis.adoc#virt-deleting-vmis-cli_virt-manage-vmis[virtual machine instances],
and xref:../../virt/virtual_machines/virtual_disks/virt-deleting-datavolumes.adoc#virt-deleting-dvs_virt-deleting-datavolumes[data volumes].
You must first delete all xref:../../virt/virtual_machines/virt-delete-vms.adoc#virt-delete-vm-web_virt-delete-vms[virtual machines], and xref:../../virt/virtual_machines/virt-manage-vmis.adoc#virt-deleting-vmis-cli_virt-manage-vmis[virtual machine instances].
You cannot uninstall {VirtProductName} while its workloads remain on the cluster.
====
@@ -34,4 +33,9 @@ include::modules/deleting-a-namespace-using-the-web-console.adoc[leveloffset=+2]
include::modules/virt-deleting-virt-crds-web.adoc[leveloffset=+2]
include::modules/virt-deleting-virt-cli.adoc[leveloffset=+1]
include::modules/virt-deleting-virt-cli.adoc[leveloffset=+1]
[role="_additional-resources"]
.Additional resources
* xref:../../virt/virtual_machines/virt-delete-vms.adoc#virt-delete-vm-web_virt-delete-vms[Deleting virtual machines]
* xref:../../virt/virtual_machines/virt-manage-vmis.adoc#virt-deleting-vmis-cli_virt-manage-vmis[Deleting virtual machine instances]

View File

@@ -22,5 +22,3 @@ role can create cluster roles.
include::modules/virt-about-datavolumes.adoc[leveloffset=+1]
include::modules/virt-creating-rbac-cloning-dvs.adoc[leveloffset=+1]

View File

@@ -12,6 +12,8 @@ You do not need to perform any action to enable smart-cloning, but you need to e
When you create a data volume with a persistent volume claim (PVC) source, you automatically initiate the cloning process. You always receive a clone of the data volume if your environment supports smart-cloning or not. However, you will only receive the performance benefits of smart cloning if your storage provider supports smart-cloning.
include::modules/virt-about-datavolumes.adoc[leveloffset=+1]
include::modules/virt-about-smart-cloning.adoc[leveloffset=+1]
include::modules/virt-cloning-a-datavolume.adoc[leveloffset=+1]

View File

@@ -6,7 +6,7 @@ include::_attributes/common-attributes.adoc[]
toc::[]
When you create a data volume, the Containerized Data Importer (CDI) creates a persistent volume claim (PVC) and populates the PVC with your data. You can create a data volume as either a standalone resource or by using a `dataVolumeTemplate` resource in a virtual machine specification. You create a data volume by using either the PVC API or storage APIs.
You can create a data volume by using either the PVC or storage API.
[IMPORTANT]
====
@@ -26,6 +26,8 @@ Storage profiles enable you to create data volumes quickly while reducing coding
For recognized storage types, the CDI provides values that optimize the creation of PVCs. However, you can configure automatic settings for a storage class if you customize the storage profile.
include::modules/virt-about-datavolumes.adoc[leveloffset=+1]
include::modules/virt-creating-data-volumes-using-storage-api.adoc[leveloffset=+1]
include::modules/virt-creating-data-volumes-using-pvc-api.adoc[leveloffset=+1]

View File

@@ -1,17 +0,0 @@
:_content-type: ASSEMBLY
[id="virt-deleting-datavolumes"]
= Deleting data volumes
include::_attributes/common-attributes.adoc[]
:context: virt-deleting-datavolumes
toc::[]
You can manually delete a data volume by using the `oc` command-line interface. +
[NOTE]
====
When you delete a virtual machine, the data volume it uses is automatically deleted.
====
include::modules/virt-about-datavolumes.adoc[leveloffset=+1]
include::modules/virt-listing-dvs.adoc[leveloffset=+1]
include::modules/virt-deleting-dvs.adoc[leveloffset=+1]