Red Hat Bugzilla – Bug 787221
Methods in Drift.js are not in CLI API Doc
Last modified: 2012-02-14 12:19:26 EST
+++ This bug was initially created as a clone of Bug #751248 +++ Methods in Drift.js are not in CLI API Doc. Specifically:
The following are the steps to test the required CLI script. The needed script itself is mentioned in step 4) below:
1) Create a bundle containing an EAP instance
2) Provision that bundle to a platform
3) Setup drift to monitor that EAP instance
*4) Create a CLI script which redeploys the bundle from step 1, returning the EAP instance to its original state
5) Setup an alert to trigger when drift is detected, and have the script from step 4 be fired when the alert triggers
6) Update the EAP instance, thus triggering drift, and watch as the script reprovisions the EAP instance.
--- Additional comment from email@example.com on 2011-11-18 12:18:00 EST ---
1) Create an EAP 5.1.1 bundle using a script I wrote, which has been checked into master at etc/scripts/create-jbossas-bundle.sh. The script is run as follows:
where jboss-eap-5.1.1.zip is the EAP 5.1.1 dist zipfile. This outputs a bundle distribution zipfile named jboss-eap-5.1.1-bundle.zip.
2) Use the bundle create wizard in the GUI to create a bundle from jboss-eap-5.1.1-bundle.zip. Create a compat group containing one or more platforms. Create a bundle destination containing the platforms group with a deploy dir of "/tmp/jboss-eap-5.1.". Deploy the bundle to this bundle destination. For each platform:
a) uncomment the admin=admin line in /tmp/jboss-eap-5.1.1/server/production/conf/props/jmx-console-users.properties.
b) start the EAP server: /tmp/jboss-eap-5.1.1/bin/run.sh -b 127.0.0.51 -c production
c) wait for the EAP server to fully start, then run "discovery -f" at that platform's agent prompt to discover the new EAP server
d) from the GUI, import the newly discovered EAP server resource
3) for each of the EAP server resources, create a drift definition based off the base files template (this def will monitor the bin, common, and lib dirs for drift)
4) Setup an alert on the EAP server resource that triggers when drift is detected. Add a notification of type 'CLI script' and upload the attached fix-bundle-deployment.js script.
5) Manually modify some file under the bin directory of one of the EAP servers (e.g. add the line "######## BLAH ########" to bin/classpath.sh). Select the drift definition for the corresponding EAP server resource and click the Detect Now button. Wait for the drift definition to report it is Out of Compliance (should only take a minute or so). Wait for the alert defined in step 4 to fire. Watch as the script reprovisions the EAP instance.
--- Additional comment from firstname.lastname@example.org on 2011-11-18 12:19:27 EST ---
Created attachment 534456 [details]
RHQ-server script that redeploys a bundle
--- Additional comment from email@example.com on 2011-11-18 12:22:10 EST ---
Note, for step 4, before you upload fix-bundle-deployment.js, you will need to edit the following two lines in that file and set them to the destination ID and bundle version ID corresponding to the destination and bundle version you created in step 2:
var destinationId = 10002;
var bundleVersionId = 10002;
--- Additional comment from firstname.lastname@example.org on 2011-11-29 11:49:30 EST ---
changing priority to low ... sample script ... no impact on runtime
--- Additional comment from email@example.com on 2011-11-30 14:45:15 EST ---
It doesn't impact the run time, but I've asked Lukas to test it out and make it available under /downloads from the JON server, so that people who want it can grab it.
--- Additional comment from firstname.lastname@example.org on 2011-12-01 11:15:44 EST ---
The change is in master.
The script is downloadable from the server and the Administration/Downloads page was updated to contain it (more scripts are automatically picked up if placed in the same location).
I also slightly updated the script to contain more guiding documentation.
Author: Lukas Krejci <email@example.com>
Date: Thu Dec 1 14:50:06 2011 +0100
[BZ 751248] - Make the sample CLI alert scripts downloadable from the server's /download/cli-alert-scripts location and from the Downloads section of the GUI.
--- Additional comment from firstname.lastname@example.org on 2011-12-02 11:12:49 EST ---
release_jon3.x contains only the script and makes it accessible for download. The UI changes were left out from the release. The location of the script is only to be mentioned in the documentation.
Author: Lukas Krejci <email@example.com>
Date: Fri Dec 2 17:01:58 2011 +0100
[BZ 751248] - in JON 3.0.0 we are going to make the script downloadable but
will provide no UI for accessing it. The script can be downloaded from
DriftManager.generateUnifiedDiff is in the remote API here:
DriftManager.getDriftFileAsByteArray is missing, but the issue is covered in bug 786224.