Browse Source

clarified a few, possibly dubious things in the documentation, as discussed on the SmartOS mailing list

master
Tamás Gérczei 2 years ago
parent
commit
3151af4732
Signed by: tgerczei GPG Key ID: 9E1246D452248DCE
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      README.md

+ 3
- 3
README.md View File

@@ -2,14 +2,14 @@ A makeshift solution to extend <a href="http://www.smartos.org">SmartOS</a> with

A logical pre-requisite of all this is tagging the VMs ideally upon creation or otherwise:

<i>vmadm list -Ho uuid | while read UUID; do vmadm update $UUID \<\<\< "{\"set_tags\": {\"priority\": 0}}"; done</i>
<i>vmadm list -Ho uuid | while read UUID; do vmadm update $UUID \<\<\< "{\\"set_tags\\": {\\"priority\\": 0}}"; done</i>

This will tag all VMs with the priority of 0 which will leave them <strong>stopped</strong>. Afterwards an actual order needs to be established by assigning non-zero values to them one by one in ascending order where lesser values represent higher priorities - with the notable exception of 0 - and thus earlier start-up:

<i>vmadm update \<UUID\> \<\<\< "{\"set_tags\": {\"priority\": 100}}"</i>
<i>vmadm update \<UUID\> \<\<\< "{\\"set_tags\\": {\\"priority\\": 100}}"</i>

...and so on. Informational messages are logged via the syslog facility as '<i>daemon.notice</i>' entries tracking the determined order as well as the outcome for every step taken. The solution comprises two services backed by the same single method script: one activated before <i>svc:/system/zones</i> in order to convince it not to start any guests and the actual payload starting once vmadmd is available to evaluate the tags and complete the sequence.

SMF will import the manifests for the services upon boot-up when it initializes its repository. The location of the method script is configurable via the service property <i>config/method_prefix</i>, defaulting to <strong><i>/opt/custom/bin</i></strong>. The start-up delay defaults to <strong><i>30</i></strong> seconds, also configurable via the context environment variable <i>DELAY</i> for the method <i>start</i>. A grace period of <strong>5</strong> minutes is granted for shut-down, configurable via the context environment variables <i>GRACE_PERIOD</i> and <i>WAIT_INTERVAL</i> in the <i>stop</i> method.
SMF will import the manifests (the XML documents in this repository) for the services upon boot-up when it initializes its repository, provided they are placed under a directory named <strong><i>/opt/custom/smf</i></strong>. The location of the method script is configurable via the service property <i>config/method_prefix</i>, defaulting to <strong><i>/opt/custom/bin</i></strong> - the file needs to be executable and this directory may have to be created first, unless another, already present one is chosen. The start-up delay defaults to <strong><i>30</i></strong> seconds, also configurable via the context environment variable <i>DELAY</i> for the method <i>start</i>. A grace period of <strong>5</strong> minutes is granted for shut-down, configurable via the context environment variables <i>GRACE_PERIOD</i> and <i>WAIT_INTERVAL</i> in the <i>stop</i> method.

In the future the method script might get re-written in node.js in order to make a more human-friendly dependency notation/handling possible. This is merely the shortest path.

Loading…
Cancel
Save