Reference For: developers, administrators

kyvernon vm

The vm command of the kyvernon CLI with its subcommands and arguments.

kyvernon vm

Virtual machine operations

Usage
kyvernon vm <COMMAND>

Subcommands: power-on, power-off, shutdown, reset, suspend, delete, create, reconfigure, serial-log, snapshot, console, guest-agent-offer, clone, mark-as-template, mark-as-vm, unregister, backup, register, customize, relocate, resolve-migration, export, guest

kyvernon vm power-on

Power on

Usage
kyvernon vm power-on [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM id (vm-N)yes
--waitWait for the task to finish and print it
--idempotency-keyIdempotency key (a retry with the same key returns the same task)

API operation: POST /v1/vms/{id}/power-on

kyvernon vm power-off

Power off hard, at once (the guest is not asked; see shutdown)

Usage
kyvernon vm power-off [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM id (vm-N)yes
--waitWait for the task to finish and print it
--idempotency-keyIdempotency key (a retry with the same key returns the same task)

API operation: POST /v1/vms/{id}/power-off

kyvernon vm shutdown

Shut down gracefully: the guest is asked to power off; after the timeout the VM is powered off hard

Usage
kyvernon vm shutdown [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM id (vm-N)yes
--timeoutSeconds the guest gets before the hard power-off (default 90)
--waitWait for the task to finish and print it
--idempotency-keyIdempotency key (a retry with the same key returns the same task)

API operation: POST /v1/vms/{id}/shutdown

kyvernon vm reset

Reset

Usage
kyvernon vm reset [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM id (vm-N)yes
--waitWait for the task to finish and print it
--idempotency-keyIdempotency key (a retry with the same key returns the same task)

API operation: POST /v1/vms/{id}/reset

kyvernon vm suspend

Suspend

Usage
kyvernon vm suspend [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM id (vm-N)yes
--waitWait for the task to finish and print it
--idempotency-keyIdempotency key (a retry with the same key returns the same task)

API operation: POST /v1/vms/{id}/suspend

kyvernon vm delete

Delete (must be powered off)

Usage
kyvernon vm delete [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM id (vm-N)yes
--waitWait for the task to finish and print it
--idempotency-keyIdempotency key (a retry with the same key returns the same task)

API operation: DELETE /v1/vms/{id}

kyvernon vm create

Create from a JSON spec (VirtualMachine schema)

Usage
kyvernon vm create [OPTIONS]
ArgumentDescriptionRequired
--folderVM folder id (group-vN)yes
--specPath to the spec JSON (VirtualMachine schema; - for stdin)yes
--hostHost to place it on
--create-diskDisk files to create first, as JSON (DiskFileRequest schema; repeat)
--firmwareFirmware, replacing config.firmware of the spec
values bios, efi
--waitWait for the task to finish and print it
--idempotency-keyIdempotency key (a retry with the same key returns the same task)

API operation: POST /v1/vms

kyvernon vm reconfigure

Reconfigure from a JSON config (VmConfig schema); optionally rename

Usage
kyvernon vm reconfigure [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--configPath to the config JSON (- for stdin)yes
--nameNew name
--create-diskDisk files to create (DiskFileRequest JSON; repeat)
--grow-diskDisk files to grow (DiskFileRequest JSON; repeat)
--delete-diskDisk files to delete (DiskFileRequest JSON; repeat)
--firmwareFirmware, replacing firmware of the config (the VM must be powered off)
values bios, efi
--waitWait for the task to finish and print it
--idempotency-keyIdempotency key (a retry with the same key returns the same task)

API operation: POST /v1/vms/{id}/reconfigure

kyvernon vm serial-log

Tail of the serial console log

Usage
kyvernon vm serial-log [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--max-bytesBytes from the end

API operation: GET /v1/vms/{id}/serial-log

kyvernon vm snapshot

Snapshots

Usage
kyvernon vm snapshot <COMMAND>

Subcommands: create, revert, remove, remove-all, rename

kyvernon vm snapshot create

Create a snapshot

Usage
kyvernon vm snapshot create [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--nameNameyes
--descriptionDescription
--memoryInclude the memory state
--quiesceQuiesce the guest file systems
--waitWait for the task to finish and print it
--idempotency-keyIdempotency key (a retry with the same key returns the same task)

API operation: POST /v1/vms/{id}/snapshots

kyvernon vm snapshot revert

Revert to a snapshot

Usage
kyvernon vm snapshot revert [OPTIONS] <ID> <KEY>
ArgumentDescriptionRequired
<ID>VM idyes
<KEY>Snapshot keyyes
--suppress-power-onStay powered off even if the snapshot was taken powered on
--waitWait for the task to finish and print it
--idempotency-keyIdempotency key (a retry with the same key returns the same task)

API operation: POST /v1/vms/{id}/snapshots/{key}/revert

kyvernon vm snapshot remove

Remove a snapshot

Usage
kyvernon vm snapshot remove [OPTIONS] <ID> <KEY>
ArgumentDescriptionRequired
<ID>VM idyes
<KEY>Snapshot keyyes
--childrenAlso remove child snapshots
--waitWait for the task

API operation: DELETE /v1/vms/{id}/snapshots/{key}

kyvernon vm snapshot remove-all

Remove every snapshot

Usage
kyvernon vm snapshot remove-all [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--waitWait for the task

API operation: DELETE /v1/vms/{id}/snapshots

kyvernon vm snapshot rename

Rename a snapshot (display name and/or description)

Usage
kyvernon vm snapshot rename [OPTIONS] <ID> <KEY>
ArgumentDescriptionRequired
<ID>VM idyes
<KEY>Snapshot keyyes
--nameNew display name
--descriptionNew description (empty string clears it)

API operation: POST /v1/vms/{id}/snapshots/{key}/rename

kyvernon vm console

Graphical console: tickets and screenshots

Usage
kyvernon vm console <COMMAND>

Subcommands: ticket, screenshot

kyvernon vm console ticket

Issue a single-use console ticket (30 s) for the WebSocket at /v1/console/{ticket}

Usage
kyvernon vm console ticket <ID>
ArgumentDescriptionRequired
<ID>VM idyes

API operation: POST /v1/vms/{id}/console/ticket

kyvernon vm console screenshot

Save a PNG screenshot of the console

Usage
kyvernon vm console screenshot [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--max-widthScale the image down to this width in pixels
--toOutput file (default: <id>.png)

API operation: GET /v1/vms/{id}/console/screenshot

kyvernon vm guest-agent-offer

Whether to offer installing the guest agent for a VM created from a template

Usage
kyvernon vm guest-agent-offer <TEMPLATE>
ArgumentDescriptionRequired
<TEMPLATE>Template, image name or guest OS (ubuntu-24.04, debian-13, ubuntu64Guest)yes

API operation: POST /v1/guest-agent/offer

kyvernon vm clone

Clone

Usage
kyvernon vm clone [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>Source VM idyes
--nameName of the cloneyes
--folderTarget folder (default: the source's)
--resource-poolTarget resource pool
--hostTarget host
--datastoreTarget datastore
--linkedLinked clone from --snapshot
--snapshotSnapshot key to clone from
--power-onPower the clone on
--templateMake the clone a template
--waitWait for the task to finish and print it
--idempotency-keyIdempotency key (a retry with the same key returns the same task)

API operation: POST /v1/vms/{id}/clone

kyvernon vm mark-as-template

Mark a powered-off VM as a template

Usage
kyvernon vm mark-as-template <ID>
ArgumentDescriptionRequired
<ID>VM idyes

API operation: POST /v1/vms/{id}/mark-as-template

kyvernon vm mark-as-vm

Convert a template back to a VM

Usage
kyvernon vm mark-as-vm [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--resource-poolResource pool
--hostHost

API operation: POST /v1/vms/{id}/mark-as-vm

kyvernon vm unregister

Remove from the inventory, keeping the disk files

Usage
kyvernon vm unregister <ID>
ArgumentDescriptionRequired
<ID>VM idyes

API operation: POST /v1/vms/{id}/unregister

kyvernon vm backup

Back the VM up to the backup repository now (a task)

Usage
kyvernon vm backup [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--quiesceQuiescing: NONE, PREFERRED or REQUIRED (default: the backup settings)
--fullTransfer every allocated area even when an incremental backup is possible
--waitWait for the task

API operation: POST /v1/backup/points

kyvernon vm register

Register an existing VM from a datastore path (keeps disks)

Usage
kyvernon vm register [OPTIONS]
ArgumentDescriptionRequired
--folderDestination VM folder (group-vN)yes
--pathDatastore path ([ds] name/name.vmx)yes
--nameDisplay name (defaults to the on-disk manifest name)
--as-templateRegister as a template
--resource-poolResource pool (resgroup-N; required unless --as-template)
--hostHost (host-N)
--waitWait for the task to finish and print it
--idempotency-keyIdempotency key (a retry with the same key returns the same task)

API operation: POST /v1/vms/register

kyvernon vm customize

Apply a named customization specification (powered-off VM)

Usage
kyvernon vm customize [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--specCatalogue specification nameyes
--waitWait for the task to finish and print it
--idempotency-keyIdempotency key (a retry with the same key returns the same task)

API operation: POST /v1/vms/{id}/customize

kyvernon vm relocate

Relocate a VM (host / pool / folder / cold storage datastore)

Usage
kyvernon vm relocate [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--hostDestination host (host-N)
--resource-poolDestination resource pool (resgroup-N)
--folderDestination VM folder (group-vN)
--datastoreDestination datastore for cold storage relocate (datastore-N)
--diskPer-disk locator KEY=datastore-N (repeatable; cold relocate only)
--nicEthernet rebind KEY=network-N (repeatable; RelocateVM deviceChange)
--waitWait for the task to finish and print it
--idempotency-keyIdempotency key (a retry with the same key returns the same task)

API operation: POST /v1/vms/{id}/relocate

kyvernon vm resolve-migration

Resolve a VM fenced after a migration with an unknown outcome

Usage
kyvernon vm resolve-migration [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--resolutionWho keeps the guest: source-keeps or destination-keepsyes
--hostDestination host (host-N); required with destination-keeps

API operation: POST /v1/vms/{id}/resolve-migration

kyvernon vm export

Export a VM over a native NFC lease (POST /v1/vms/{id}/export)

Usage
kyvernon vm export <ID>
ArgumentDescriptionRequired
<ID>VM idyes

API operation: POST /v1/vms/{id}/export

kyvernon vm guest

Guest operations through the guest agent

Usage
kyvernon vm guest <COMMAND>

Subcommands: validate, acquire, release, start, list, terminate, env, read-file, write-file, list-files, mkdir, delete-file, rmdir, move-file, move-dir, change-attrs, temp-file, temp-dir

kyvernon vm guest validate

Probe whether guest operations are available (ValidateCredentialsInGuest)

Usage
kyvernon vm guest validate [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--usernameGuest username (accepted, not checked)

API operation: POST /v1/vms/{id}/guest/credentials/validate

kyvernon vm guest acquire

Acquire guest credentials echo (AcquireCredentialsInGuest)

Usage
kyvernon vm guest acquire [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--usernameGuest username (accepted, not checked)

API operation: POST /v1/vms/{id}/guest/credentials/acquire

kyvernon vm guest release

Release guest credentials (ReleaseCredentialsInGuest)

Usage
kyvernon vm guest release <ID>
ArgumentDescriptionRequired
<ID>VM idyes

API operation: POST /v1/vms/{id}/guest/credentials/release

kyvernon vm guest start

Start a program in the guest

Usage
kyvernon vm guest start [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--programProgram path in the guestyes
--argumentsArguments (one string)
--usernameGuest username (accepted, not checked)

API operation: POST /v1/vms/{id}/guest/processes

kyvernon vm guest list

List guest processes started through guest ops

Usage
kyvernon vm guest list [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--pidFilter to these process ids

API operation: GET /v1/vms/{id}/guest/processes

kyvernon vm guest terminate

Terminate a guest process

Usage
kyvernon vm guest terminate <ID> <PID>
ArgumentDescriptionRequired
<ID>VM idyes
<PID>Process idyes

API operation: DELETE /v1/vms/{id}/guest/processes/{pid}

kyvernon vm guest env

Read guest environment variables

Usage
kyvernon vm guest env [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--nameVariable names (empty: all)

API operation: GET /v1/vms/{id}/guest/environment

kyvernon vm guest read-file

Read a file from the guest (Base64 in the JSON response)

Usage
kyvernon vm guest read-file [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--pathPath in the guestyes

API operation: POST /v1/vms/{id}/guest/files/read

kyvernon vm guest write-file

Write a file into the guest from a local file (Base64-encoded on the wire)

Usage
kyvernon vm guest write-file [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--pathPath in the guestyes
--fromLocal file to uploadyes
--no-overwriteRefuse to overwrite an existing guest file

API operation: POST /v1/vms/{id}/guest/files/write

kyvernon vm guest list-files

List files or directory children in the guest

Usage
kyvernon vm guest list-files [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--pathDirectory or file path in the guestyes
--indexZero-based start index
--max-resultsCap on returned entries
--match-patternBasename regex (grep -E)

API operation: POST /v1/vms/{id}/guest/files/list

kyvernon vm guest mkdir

Create a directory in the guest

Usage
kyvernon vm guest mkdir [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--pathDirectory path in the guestyes
--parentsCreate missing parents

API operation: POST /v1/vms/{id}/guest/files/mkdir

kyvernon vm guest delete-file

Delete a file in the guest (not a directory)

Usage
kyvernon vm guest delete-file [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--pathFile path in the guestyes

API operation: POST /v1/vms/{id}/guest/files/delete

kyvernon vm guest rmdir

Delete a directory in the guest

Usage
kyvernon vm guest rmdir [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--pathDirectory path in the guestyes
--recursiveRemove contents too

API operation: POST /v1/vms/{id}/guest/files/rmdir

kyvernon vm guest move-file

Move or rename a file in the guest

Usage
kyvernon vm guest move-file [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--srcSource path in the guestyes
--dstDestination path in the guestyes
--overwriteReplace an existing destination file

API operation: POST /v1/vms/{id}/guest/files/move

kyvernon vm guest move-dir

Move or rename a directory in the guest

Usage
kyvernon vm guest move-dir [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--srcSource directory path in the guestyes
--dstDestination directory path in the guestyes

API operation: POST /v1/vms/{id}/guest/files/move-dir

kyvernon vm guest change-attrs

Change posix file attributes in the guest

Usage
kyvernon vm guest change-attrs [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--pathPath in the guestyes
--owner-idOwner uid
--group-idGroup gid
--permissionsMode bits as VMware permissions (e.g. 420 = 0644)
--access-time-unixAccess time, Unix seconds
--modification-time-unixModification time, Unix seconds

API operation: POST /v1/vms/{id}/guest/files/attrs

kyvernon vm guest temp-file

Create a temporary file in the guest

Usage
kyvernon vm guest temp-file [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--prefixName prefix (no path separators)
--suffixName suffix (no path separators)
--directory-pathParent directory (default guest /tmp)

API operation: POST /v1/vms/{id}/guest/files/temp-file

kyvernon vm guest temp-dir

Create a temporary directory in the guest

Usage
kyvernon vm guest temp-dir [OPTIONS] <ID>
ArgumentDescriptionRequired
<ID>VM idyes
--prefixName prefix (no path separators)
--suffixName suffix (no path separators)
--directory-pathParent directory (default guest /tmp)

API operation: POST /v1/vms/{id}/guest/files/temp-dir

Version 0.1.