start spice/vnc ports at 5900 and skip 6000

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-27 07:06:12 -05:00
parent 212b582060
commit 7288595efc
4 changed files with 11 additions and 3 deletions

View File

@ -46,6 +46,7 @@ func main() {
// how long a droplet can be missing until it's declared dead // how long a droplet can be missing until it's declared dead
me.unstableTimeout = 17 * time.Second 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 // how long the cluster must be stable before new droplets can be started
me.clusterStableDuration = 37 * time.Second me.clusterStableDuration = 37 * time.Second

View File

@ -124,7 +124,7 @@ func clusterHealthy() (bool, string) {
missing = append(missing, d) missing = append(missing, d)
} else { } else {
dur := time.Since(d.LastPoll.AsTime()) // Calculate the elapsed time 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)) log.Info("GOOD STATE MISSING", d.Hostname, hname, shell.FormatDuration(dur))
good = false good = false
d.CurrentState = pb.DropletState_UNKNOWN d.CurrentState = pb.DropletState_UNKNOWN

View File

@ -28,8 +28,9 @@ type virtigoT struct {
killcount int killcount int
unstable time.Time // the last time the cluster was incorrect unstable time.Time // the last time the cluster was incorrect
changed bool 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 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 // the stuff that is needed for a hypervisor

View File

@ -242,8 +242,14 @@ func setUniqueSpicePort(check *pb.Droplet) error {
} }
var start int64 var start int64
start = 6000 start = 5900
for { 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 { if _, ok := ports[start]; ok {
d := ports[start] d := ports[start]
log.Info("already using port", start, "on", d.Hostname) log.Info("already using port", start, "on", d.Hostname)