Skip to main content

Overview

VMInfo is a Pydantic model that provides comprehensive runtime information about a VM. It includes the current lifecycle state, configuration, networking details, and process identifiers.

Model Definition

All VMInfo instances are immutable (frozen) after creation.

Fields

vm_id
str
The VM identifier. This is the unique ID assigned when the VM was created.
status
VMState
Current lifecycle state of the VM. Possible values:
  • VMState.CREATED: VM has been created but not started
  • VMState.RUNNING: VM is currently running
  • VMState.STOPPED: VM has been stopped
  • VMState.ERROR: VM encountered an error
config
VMConfig
The VM configuration used to create this VM. Contains all settings including CPU count, memory, kernel path, rootfs path, boot args, and environment variables.
network
NetworkConfig | None
Network configuration for the VM. Contains guest IP, gateway, TAP device name, MAC address, and optional SSH port forwarding.None if the VM has not been configured with networking.
pid
int | None
Process ID of the Firecracker/QEMU process running the VM.None if the VM is not currently running.
socket_path
Path | None
Path to the Firecracker API socket for this VM.None if the socket has not been created or the VM is not running.

Nested Types

VMState Enum

NetworkConfig

VMConfig

See the VMConfig documentation for complete field details.

Usage Examples

Accessing VM Information

Checking VM Status

Accessing Network Configuration

Inspecting VM Configuration

Refreshing VM Information

Using VMInfo Outside Context Manager

Monitoring VM Process

Accessing Socket Path

Comparing VM Configurations

Persisting VM Information

Reconnecting Using VMInfo

Immutability

VMInfo instances are frozen and cannot be modified:

Field Summary

Last modified on May 5, 2026