osmates vm export
Write a shut-down machine's disk into a RAW or qcow2 file.
osmates vm export [<options>] <machine> <file>osmatesd writes the disk from a clone, so the machine can start again at once. The file is made new; --replace writes over one that exists, which osmatesd empties only once it checked it: never a file in the OSMates library. RAW skips zeros on a volume that keeps holes; qcow2 is version 3 with 64 KiB clusters, which QEMU and the apps built on it read. A cancelled or failed export leaves no file it made, and a file it was replacing empty. Bring the disk back with osmates vm import <file>, or for Linux osmates vm create <name> --image <file>.
Arguments
<machine>RequiredThe machine, shut down.
<file>RequiredThe file to write.
--format <format>The file's format.
One of
raw,qcow2.Default:
raw--disk <disk>Which disk: 1 for the machine's own, 2 and on for the disks its import brought.
Default:
1--replaceWrite over the file if it exists.
--jsonPrint machine-readable JSON.
JSON output
With --json, it prints an object with these fields.
JSON Schema: /schemas/0/cli/vm/export.json
diskintegerRequiredformatstringRequiredOne of
raw,qcow2.machinestringRequiredvirtualSizeintegerRequiredAt least 0.
writtenintegerRequiredAt least 0.
Exit statuses
Its exit status is one of these.
| Status | Meaning |
|---|---|
| 0 | The command did what it was asked. |
| 1 | The command failed; with --json, standard error's last line is the error object. |
| 64 | The command line is wrong, as ArgumentParser found before the command ran. |
| 65 | What was given is wrong, found while the command ran; the same command fails until it changes. |
| 75 | The same command can work later with nothing changed, as while an update finishes. |
| 130 | Control-C cancelled what the command started. |