2024-10-18 20:58:15 -05:00
|
|
|
syntax = "proto3";
|
|
|
|
package virtbuf;
|
|
|
|
|
2024-10-26 08:54:48 -05:00
|
|
|
import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp
|
2024-10-22 14:40:59 -05:00
|
|
|
|
2024-10-23 00:24:09 -05:00
|
|
|
message Droplets {
|
2024-10-24 16:57:50 -05:00
|
|
|
string uuid = 1; // I guess why not just have this on each file
|
|
|
|
string version = 2; // maybe can be used for protobuf schema change violations
|
|
|
|
repeated Droplet droplets = 3;
|
2024-10-23 00:24:09 -05:00
|
|
|
}
|
|
|
|
|
2024-10-18 20:58:15 -05:00
|
|
|
message Droplet {
|
2024-10-31 09:13:02 -05:00
|
|
|
string uuid = 1; // should be unique across the cluster
|
|
|
|
string hostname = 2; // should be unique and work in DNS
|
|
|
|
int64 cpus = 3; // what's the point of int64 vs int32
|
|
|
|
int64 memory = 4; // in bytes
|
|
|
|
Current current = 5; // what the state and values of the droplet is
|
|
|
|
DropletState start_state = 6; // what the state of the droplet is SUPPOSED TO BE ('on' or 'off')
|
|
|
|
string qemu_machine = 7; // the qemu machine type to use "pc-q35-9.0"
|
|
|
|
int64 spice_port = 8; // preferred port to use for spice
|
2024-10-31 01:59:18 -05:00
|
|
|
|
2024-10-31 09:13:02 -05:00
|
|
|
string preferred_hypervisor = 9; // the hypervisor to prefer to run the droplet on
|
|
|
|
string force_hypervisor = 10; // use this hypervisor and this hypervisor only
|
|
|
|
string preferred_arch = 11; // the cpu arch to use "x86_64" (should really get this from the disk?)
|
2024-10-31 01:59:18 -05:00
|
|
|
repeated Network networks = 12; // really just mac addresses. should be unique across cluster
|
|
|
|
repeated Disk disks = 13; // disks to attach
|
|
|
|
|
2024-10-31 09:13:02 -05:00
|
|
|
string local_only = 14; // this is only defined locally on the hypervisor
|
|
|
|
string custom_xml = 15; // if needed,
|
|
|
|
DropletArchive archive = 16; // what the state of the droplet is SUPPOSED TO BE ('on' or 'off')
|
2024-10-22 17:53:43 -05:00
|
|
|
}
|
2024-10-18 20:58:15 -05:00
|
|
|
|
2024-10-31 04:29:51 -05:00
|
|
|
// volatile data. the current settings and values of things.
|
2024-10-31 04:06:17 -05:00
|
|
|
// These are passed around while the cluster to monitor and control the systems
|
|
|
|
// but they are not saved to the config file
|
|
|
|
message Current {
|
2024-10-31 04:21:46 -05:00
|
|
|
DropletState state = 1; // used to track the current state before taking any action
|
|
|
|
string hypervisor = 2; // the current hypervisor the droplet is running on
|
|
|
|
int64 start_attempts = 3; // how many times a start has been attempted
|
|
|
|
string full_xml = 4; // the full libvirt xml to import
|
|
|
|
google.protobuf.Timestamp last_poll = 5; // the last time we heard anything from this droplet
|
|
|
|
string image_url = 6; // url to the image
|
2024-10-31 04:06:17 -05:00
|
|
|
}
|
|
|
|
|
2024-10-31 09:13:02 -05:00
|
|
|
message Archive {
|
|
|
|
DropletArchive reason = 1; // why the droplet was archived
|
|
|
|
google.protobuf.Timestamp when = 2; // when it was archived
|
|
|
|
}
|
|
|
|
|
2024-10-31 04:06:17 -05:00
|
|
|
// virtual machine state
|
2024-10-23 19:16:22 -05:00
|
|
|
enum DropletState {
|
2024-10-31 04:06:17 -05:00
|
|
|
ON = 0;
|
|
|
|
OFF = 1;
|
|
|
|
UNKNOWN = 2; // qemu says 'Shutdown'
|
|
|
|
PAUSED = 3;
|
|
|
|
CRASHED = 4;
|
|
|
|
INMIGRATE = 5;
|
2024-10-23 19:16:22 -05:00
|
|
|
}
|
2024-10-23 17:39:50 -05:00
|
|
|
|
2024-10-31 09:13:02 -05:00
|
|
|
enum DropletArchive {
|
|
|
|
ARCHIVE_DUP = 0;
|
|
|
|
ARCHIVE_USER = 1;
|
|
|
|
}
|
|
|
|
|
2024-10-22 17:53:43 -05:00
|
|
|
message Network {
|
|
|
|
string mac = 1;
|
|
|
|
string name = 2;
|
2024-10-22 17:39:12 -05:00
|
|
|
}
|
2024-10-22 16:33:36 -05:00
|
|
|
|
2024-10-22 17:39:12 -05:00
|
|
|
message Disk {
|
|
|
|
string filename = 1;
|
2024-10-26 00:23:26 -05:00
|
|
|
string filepath = 2;
|
|
|
|
int64 size = 3;
|
2024-10-31 04:06:17 -05:00
|
|
|
string qemu_arch = 4; // what arch. example: "x86_64" or "riscv64"
|
2024-10-22 16:42:14 -05:00
|
|
|
}
|