1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/virt-vm-export-commands.adoc
2025-11-18 16:29:25 +01:00

59 lines
2.8 KiB
Plaintext

:_newdoc-version: 2.18.5
:_template-generated: 2025-08-13
:_mod-docs-content-type: REFERENCE
[id="vm-export-commands_{context}"]
= VM export commands
[role="_abstract"]
Use `virtctl vmexport` commands to create, download, or delete a volume exported from a VM, VM snapshot, or persistent volume claim (PVC). Certain manifests also contain a header secret, which grants access to the endpoint to import a disk image in a format that {VirtProductName} can use.
.VM export commands
[width="100%",cols="1a,2a",options="header"]
|===
|Command |Description
|`virtctl vmexport create <vmexport_name> --vm\|snapshot\|pvc=<object_name>`
|Create a `VirtualMachineExport` custom resource (CR) to export a volume from a VM, VM snapshot, or PVC.
* `--vm`: Exports the PVCs of a VM.
* `--snapshot`: Exports the PVCs contained in a `VirtualMachineSnapshot` CR.
* `--pvc`: Exports a PVC.
* Optional: `--ttl=1h` specifies the time to live. The default duration is 2 hours.
|`virtctl vmexport delete <vmexport_name>`
|Delete a `VirtualMachineExport` CR manually.
|`virtctl vmexport download <vmexport_name> --output=<output_file> --volume=<volume_name>`
|Download the volume defined in a `VirtualMachineExport` CR.
* `--output` specifies the file format. Example: `disk.img.gz`.
* `--volume` specifies the volume to download. This flag is optional if only one volume is available.
Optional:
* `--keep-vme` retains the `VirtualMachineExport` CR after download. The default behavior is to delete the `VirtualMachineExport` CR after download.
* `--insecure` enables an insecure HTTP connection.
|`virtctl vmexport download <vmexport_name> --vm\|snapshot\|pvc=<object_name> --output=<output_file> --volume=<volume_name>`
|Create a `VirtualMachineExport` CR and then download the volume defined in the CR.
|`virtctl vmexport download export --manifest`
|Retrieve the manifest for an existing export. The manifest does not include the header secret.
|`virtctl vmexport download export --manifest --vm=example`
|Create a VM export for a VM example, and retrieve the manifest. The manifest does not include the header secret.
|`virtctl vmexport download export --manifest --snap=example`
|Create a VM export for a VM snapshot example, and retrieve the manifest. The manifest does not include the header secret.
|`virtctl vmexport download export --manifest --include-secret`
|Retrieve the manifest for an existing export. The manifest includes the header secret.
|`virtctl vmexport download export --manifest --manifest-output-format=json`
|Retrieve the manifest for an existing export in json format. The manifest does not include the header secret.
|`virtctl vmexport download export --manifest --include-secret --output=manifest.yaml`
|Retrieve the manifest for an existing export. The manifest includes the header secret and writes it to the file specified.
|===