Skip to content

Proto

Protobuf

The VM Registry Proto repository (vm-registry-proto) contains the shared Protocol Buffer definitions that form the communication contract between the CLI (Rust) and the Daemon (Go). It defines a single gRPC service — VMService — along with all request and response message types, organized into domain-specific .proto files.

Overview

The proto definitions serve as the single source of truth for the gRPC API. Both the Rust CLI (via tonic-prost-build) and the Go daemon (via protoc-gen-go-grpc) generate their respective client and server code from these same .proto files, ensuring type-safe communication across language boundaries.

bash
vm-registry-proto/
├── vm.proto              # Service definition (imports all message defs)
└── defs/
    ├── action.proto       # VM lifecycle messages
    ├── auth.proto         # Authentication messages
    ├── compose.proto      # Multi-VM orchestration messages
    ├── context.proto      # Context management messages
    ├── image.proto        # Image management messages
    └── network.proto      # Network management messages

Service Definition

The VMService is the sole gRPC service, defined in vm.proto. It aggregates all RPCs across every domain into a unified interface exposed by the daemon over a Unix domain socket.

Authentication RPCs

RPCRequestResponseDescription
LoginLoginRequestLoginResponseAuthenticate a user and receive an access token
LogoutLogoutRequestLogoutResponseRevoke credentials and clear the session
RegisterRegisterRequestRegisterResponseCreate a new user account
HealthCheckEmptyHealthCheckResponseCheck daemon, registry, and auth server health

Image RPCs

RPCRequestResponseDescription
PullImagePullImageRequestPullImageResponseDownload an image from the remote registry
PushImagePushImageRequestPushImageResponseUpload an image to the remote registry
ImportImageImportImageRequestImportImageResponseImport a VM image with inline disk data
ImportImageStreamstream ImportImageStreamRequestImportImageResponseImport a VM image via chunked streaming
ExportImageExportImageRequestExportImageResponseExport an image to a file on disk
ListLocalImagesEmptyListLocalImagesResponseList all locally stored images
DeleteImageDeleteImageRequestDeleteImageResponseRemove a local image
GetImageManifestGetImageManifestRequestGetImageManifestResponseRetrieve an image's manifest JSON
ValidateVMFileValidateVMFileRequestValidateVMFileResponseValidate a VMFile without importing
TagImageTagImageRequestTagImageResponseCreate a new tag for an existing image
GarbageCollectGarbageCollectRequestGarbageCollectResponseClean up orphaned blobs and manifests

Context RPCs

RPCRequestResponseDescription
ContextCreateContextCreateRequestContextResponseCreate a new named context
ContextUpdateContextUpdateRequestContextResponseModify an existing context
ContextUseContextUseRequestContextResponseSwitch the active context
ContextListEmptyContextListResponseList all configured contexts
ContextRemoveContextRemoveRequestContextResponseDelete a context
ContextCurrentEmptyContextInfoResponseGet the currently active context

Action RPCs

RPCRequestResponseDescription
RunVMRunVMRequestRunVMResponseCreate and start a new VM from an image
StartVMStartVMRequestStartVMResponseStart a stopped VM
StopVMStopVMRequestStopVMResponseStop a running VM
RestartVMRestartVMRequestRestartVMResponseRestart a VM
DeleteVMDeleteVMRequestDeleteVMResponseDestroy and undefine a VM
PsVMsEmptyPsVMsResponseList running VMs with process details
ListVMsEmptyListVMsResponseList all VMs with basic info

Network RPCs

RPCRequestResponseDescription
NetworkListEmptyNetworkListResponseList all libvirt networks
NetworkGetNetworkGetRequestNetworkGetResponseGet details of a specific network
NetworkCreateNetworkCreateRequestNetworkCreateResponseCreate a new virtual network
NetworkActivateNetworkActivateRequestNetworkActivateResponseActivate an inactive network
NetworkDeactivateNetworkDeactivateRequestNetworkDeactivateResponseDeactivate a running network
NetworkDeleteNetworkDeleteRequestNetworkDeleteResponseDelete a network definition

Compose RPCs

RPCRequestResponseDescription
ComposeUpComposeUpRequestComposeUpResponseDeploy a multi-VM environment
ComposeDownComposeDownRequestComposeDownResponseTear down a compose project
ComposePsComposePsRequestComposePsResponseList services in a compose project
ComposeRestartComposeRestartRequestComposeRestartResponseRestart compose services
ComposeValidateComposeValidateRequestComposeValidateResponseValidate a VMCompose file

Key Message Types

VMFile

The VMFile message represents a complete VM image definition, used during import and validation:

FieldTypeDescription
api_versionstringAPI version (e.g., vmregistry.io/v1alpha1)
metadataVMMetadataImage name, description, author, source, and labels
specVMSpecDisk image path, format, and resource allocation

VMRunOptions

Controls how a VM is launched, sent as part of RunVMRequest:

FieldTypeDescription
memory_mbuint32Memory allocation in megabytes
vcpu_countuint32Number of virtual CPUs
ephemeralboolWhether disk changes are discarded on stop
cloud_initCloudInitConfigCloud-init user-data, meta-data, and network-config
activate_networkboolActivate the network if not already active
network_namestringName of the libvirt network to attach to

VMProcessInfo

Detailed information about a running VM, returned by PsVMs:

FieldTypeDescription
vm_idstringUnique VM identifier
namestringVM name
statusstringCurrent state (running, stopped, etc.)
imagestringSource image reference
createdstringCreation timestamp
uptimestringTime since the VM was started
networksrepeated VMNetworkInfoAttached network details (name, MAC, interface type)

NetworkInfo

Detailed network information, returned by network list and inspect operations:

FieldTypeDescription
namestringNetwork name
uuidstringLibvirt UUID
activeboolWhether the network is currently active
persistentboolWhether the network persists across restarts
autostartboolWhether the network auto-starts on host boot
modestringNetwork mode (nat, isolated, routed, bridge

Built with Go and Rust