summaryrefslogtreecommitdiff
path: root/droplet.proto
blob: 309b5ece3be89c36da57b990bfd10d2880a0bdf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
syntax = "proto3";
package virtbuf;

import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp

message Droplets {
	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;
}

message Droplet {
	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 cur                = 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	notes                   = 7;       // maybe useful for something
	string	preferred_hypervisor    = 8;       // the hypervisor to prefer to run the droplet on
	string	qemu_cpu                = 9;       // qemu-system -cpu help
	string	qemu_machine            = 10;      // qemu-system -machine help
        int64   spice_port              = 11;      // preferred port to use for spice

	repeated Network networks       = 12;      // really just mac addresses. should be unique across cluster
	repeated Disk disks             = 13;      // disks to attach

	string	force_hypervisor        = 20;      // use this hypervisor and this hypervisor only
	string  local_only              = 21;      // this is only defined locally on the hypervisor
	string  custom_xml              = 23;      // if needed,
}

// current settings for things.
// These are passed around while the cluster to monitor and control the systems
// but they are not saved to the config file
message Current {
        DropletState current_state              = 1;      // used to track the current state before taking any action
        string  current_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
}

// virtual machine state
enum DropletState {
	ON              = 0;
	OFF             = 1;
	UNKNOWN         = 2; // qemu says 'Shutdown'
	PAUSED          = 3;
	CRASHED         = 4;
	INMIGRATE       = 5;
}

message Network {
	string	mac     = 1;
	string	name	= 2;
}

message Disk {
	string	filename        = 1;
	string	filepath        = 2;
	int64	size    	= 3;
	string	qemu_arch       = 4;       // what arch. example: "x86_64" or "riscv64"
}