[pve-devel] [RFC common] startup-order: add predelay

Thomas Lamprecht t.lamprecht at proxmox.com
Tue May 3 15:37:20 CEST 2016


Sometimes it isn't enough to rely on systemd to get everything ready
before executing 'startall', as even iof a service is started it may
"do stuff" until really ready, e.g. ceph.
Add an possibility to make a pre start delay on VMs with defined
startup order, this does not break current setups by altering
the semantics of 'up'.

Some useres complained that this wasn't possible in general and
others run into real problems with ceph, or iSCSI, see:
https://forum.proxmox.com/threads/26340/
---
 src/PVE/JSONSchema.pm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm
index cde941e..0441085 100644
--- a/src/PVE/JSONSchema.pm
+++ b/src/PVE/JSONSchema.pm
@@ -403,6 +403,8 @@ sub pve_parse_startup_order {
 	    $res->{order} = $2;
 	} elsif ($p =~ m/^up=(\d+)$/) {
 	    $res->{up} = $1;
+	} elsif ($p =~ m/^predelay=(\d+)$/) {
+	    $res->{predelay} = $1;
 	} elsif ($p =~ m/^down=(\d+)$/) {
 	    $res->{down} = $1;
 	} else {
@@ -414,10 +416,16 @@ sub pve_parse_startup_order {
 }
 
 PVE::JSONSchema::register_standard_option('pve-startup-order', {
-    description => "Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped.",
+    description => "Startup and shutdown behavior. Order is a non-negative number " .
+	"defining the general startup order. Shutdown in done with reverse " .
+	"ordering. Additionally you can set the 'up' or 'down' delay in seconds, " .
+	"which specifies a delay to wait before the next Guest is started or " .
+	"stopped. A 'predelay' can be set to delay the Guests start command, " .
+	"this may be useful if, e.g., the first set of Guests needs to wait for " .
+	"an service to become ready.",
     optional => 1,
     type => 'string', format => 'pve-startup-order',
-    typetext => '[[order=]\d+] [,up=\d+] [,down=\d+] ',
+    typetext => '[[order=]\d+] [,up=\d+] [,down=\d+], [predelay=\d+]',
 });
 
 sub check_format {
-- 
2.1.4





More information about the pve-devel mailing list