summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-27 07:06:12 -0500
committerJeff Carr <[email protected]>2024-10-27 07:06:12 -0500
commit7288595efc0c029adf33f7b3edd4627810ccb0ca (patch)
tree4384562f7084b56ba6040f21cca7d21453d3d511
parent212b582060107d8e64ca9dbe8e194cc922e460fa (diff)
start spice/vnc ports at 5900 and skip 6000
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--main.go1
-rw-r--r--poll.go2
-rw-r--r--structs.go3
-rw-r--r--validate.go8
4 files changed, 11 insertions, 3 deletions
diff --git a/main.go b/main.go
index 31fbd3d..1168355 100644
--- a/main.go
+++ b/main.go
@@ -46,6 +46,7 @@ func main() {
// how long a droplet can be missing until it's declared dead
me.unstableTimeout = 17 * time.Second
+ me.missingDropletTimeout = time.Minute // not sure the difference between these values
// how long the cluster must be stable before new droplets can be started
me.clusterStableDuration = 37 * time.Second
diff --git a/poll.go b/poll.go
index c0ae08f..3e9caa7 100644
--- a/poll.go
+++ b/poll.go
@@ -124,7 +124,7 @@ func clusterHealthy() (bool, string) {
missing = append(missing, d)
} else {
dur := time.Since(d.LastPoll.AsTime()) // Calculate the elapsed time
- if dur > time.Minute {
+ if dur > me.missingDropletTimeout {
log.Info("GOOD STATE MISSING", d.Hostname, hname, shell.FormatDuration(dur))
good = false
d.CurrentState = pb.DropletState_UNKNOWN
diff --git a/structs.go b/structs.go
index 19b5c86..2671b52 100644
--- a/structs.go
+++ b/structs.go
@@ -28,8 +28,9 @@ type virtigoT struct {
killcount int
unstable time.Time // the last time the cluster was incorrect
changed bool
- unstableTimeout time.Duration // how long a droplet can be missing until it's declared dead
+ unstableTimeout time.Duration // how long a droplet can be unstable until it's declared dead
clusterStableDuration time.Duration // how long the cluster must be stable before new droplets can be started
+ missingDropletTimeout time.Duration // how long a droplet can be missing for
}
// the stuff that is needed for a hypervisor
diff --git a/validate.go b/validate.go
index 505b022..5270484 100644
--- a/validate.go
+++ b/validate.go
@@ -242,8 +242,14 @@ func setUniqueSpicePort(check *pb.Droplet) error {
}
var start int64
- start = 6000
+ start = 5900
for {
+ if start == 6000 {
+ // x11 might use this on dom0's running a desktop
+ // maybe qemu uses it iternally
+ start += 1
+ continue
+ }
if _, ok := ports[start]; ok {
d := ports[start]
log.Info("already using port", start, "on", d.Hostname)