86 Commits

Author SHA1 Message Date
Jenkins
2d2e2febb0 Merge "labs: split get_base_disk_path" 2014-09-22 13:06:29 +00:00
Roger Luethi
9fb0723cf9 labs: split get_base_disk_path
Spin off get_base_disk_name from get_base_disk_path so we can get the
disk name without the directory.

Change-Id: Id813fd9bbf8a859b639f92a380c067dfc67a95c7
2014-09-20 23:45:19 +02:00
Roger Luethi
fed4626ac0 labs: fix shared folder restore after export
Fix the code responsible for reattaching shared directories after VMs
have been exported.

For OVA export:
- use saved share names instead of default name (for the sake of
  correctness; it is unlikely that a user will change the name)

For dir export:
- save and reattach shared directories after export

Change-Id: I79162c1ec788aa1d89104aa92aebeae2bb05adf5
2014-09-20 23:44:07 +02:00
Roger Luethi
3f1ef07fdd labs: osbashauto exit on script error
Make osbashout abort if a client-side scripts returns an error; use a
file named error in the status directory to signal the problem and to
store the name of the offending script for use by Windows batch scripts.

Have osbash.sh and the Windows batch scripts exit when an error file
appears.

Change-Id: I6722e75c9c23b99e5ed25b00429026c2e0ff6a12
2014-09-14 10:55:40 +02:00
Roger Luethi
80bb373a50 labs: simplify wait_for_autofiles logic
Refactoring to make the control flow easier to understand.

Change-Id: Id38fd1c06ba51ec65577e7c6e7d7caf67acff666
2014-09-12 22:58:40 +02:00
Jenkins
1e2ec80744 Merge "labs: split out process_begin_files" 2014-09-12 20:52:36 +00:00
Jenkins
3bab42dd5d Merge "labs: fix race in preseed script" 2014-09-11 18:32:07 +00:00
Roger Luethi
412db49c57 labs: exit if ssh returns error value
With this changeset, osbash host scripts abort installation over ssh if
script execution in the VM returns an error. The patch has no effect on
installations using VirtualBox guest-addons.

Change-Id: Ibc0b297f44289cfe37e07fad1c0fcef1a30abfb2
2014-09-11 15:20:14 +02:00
Roger Luethi
d14c75c38a labs: split out process_begin_files
Move the processing of *.begin status files into a separate function.
Call that function only if the host's status directory is shared with
the client scripts (through VirtualBox guest-additions).

Change-Id: I7716528c02aa4f8b5fc0901ff91ba5d37b5a0d9f
2014-09-11 14:35:57 +02:00
Roger Luethi
6052a0455f labs: fix race in preseed script
When using the VirtualBox additions, there is a chance that after the
vboxadd service has started, the shared directory is not yet fully
available. In that case, activate_autostart.sh is never run (although
it may appear in time to be deleted).

This patch makes the script from preseed wait for activate_autostart.sh
to become available before it tries to execute it.

Change-Id: I1c2f3ef2f4301f36efec8a70b811ffe97dbaa779
2014-09-11 13:04:57 +02:00
Roger Luethi
b35c73f3b4 labs: enable host I/O cache
This patch enables host I/O cache for the VMs created by the labs
scripts.

Without host I/O cache, occasional VM filesystem corruption occured on
two out of three host systems when we started taking snapshots after
every service install on the controller VM. Typically, the affected
script would just hang. The issue is somewhat elusive: it occured only
on two out of three test hosts, and the longest observed streak of
correct controller VM builds in a row was 16 (number 17 ended with
filesystem corruption).

With host I/O cache enabled, 125 builds were successful and none failed.

Change-Id: Ib36f44fdbf9366ef781df82f225e5ac8c5bb678f
2014-09-09 09:15:43 +02:00
Roger Luethi
e41336c612 labs: bad variable reference in get_next_child_uuid
The recent renaming of local variables missed an instance of a variable.
Fixed.

Change-Id: I75da4382fc35dd288879715d987e8fabb8e2aa47
2014-09-02 06:41:54 +02:00
Roger Luethi
946114eb30 labs: pass vm_name as arg to _vbox_configure_ifs
_vbox_configure_ifs should no longer use the environment variable
NODE_NAME as the name of the node VM. It gets replaced by the correct
value passed as an argument.

Change-Id: I9d36420bcf56bbabe2f47cee2d7eb2ad824bf5d1
2014-09-01 17:43:27 +02:00
Jenkins
d815757eff Merge "labs: separate vm_name, NODE_NAME" 2014-09-01 15:36:32 +00:00
Roger Luethi
6f44c8b272 labs: check and fix private ssh key permissions
If a user changes the permissions of the Vagrant insecure ssh key,
ssh authentication doesn't work anymore and they are prompted for
a password. To prevent that, check (and adjust, if necessary) file
permissions before using ssh.

Change-Id: I90589553de30ef606c4083a1b9980c2cc80a3b3b
2014-09-01 08:40:18 +02:00
Roger Luethi
e47910e863 labs: separate vm_name, NODE_NAME
Distinguish between the name of a node VM (vm_name) and the hostname
used for the node VM. They just happened to have the same values until
now.

Change-Id: Idc457922fee886ebe504d5f56bbc86d0e5fbbd54
2014-08-31 22:11:21 +02:00
Roger Luethi
3ed47695bb labs: replace VM_BASE_NAME with local variable
There is no need for users to customize the name of the temporary VM
used for building the base disk. This patch removes that option.

Change-Id: I1e3eebf0c9f1098623d8f4ab50d938211cc78b6f
2014-08-31 21:44:32 +02:00
Jenkins
79cadac0b6 Merge "labs: rename local vars: virtualbox.install_node" 2014-08-31 19:30:40 +00:00
Roger Luethi
19c31feb91 labs: rename local vars: virtualbox.install_node
Make local variables lowercase and some of them more descriptive.

Change-Id: I14072c03243e0fc16aef4a5b6513ca530a99d911
2014-08-31 17:57:01 +02:00
Roger Luethi
b10d379990 labs: rename local vars: virtualbox.functions
Make local variables lowercase and some of them more descriptive.

Change-Id: I63bbc6a8527864ba3078804eec090a5bfc206f16
2014-08-31 08:43:48 +02:00
Jenkins
852ca5c728 Merge "labs: rename local vars: boot libs" 2014-08-31 05:17:11 +00:00
Jenkins
709a277b4a Merge "labs: rename local vars: functions.host" 2014-08-30 21:17:44 +00:00
Jenkins
d834b63393 Merge "labs: rename local vars: virtualbox.install_base" 2014-08-30 20:04:16 +00:00
Roger Luethi
8aa91f583a labs: rename local vars: functions.host
Make local variables lowercase and some of them more descriptive.

Change-Id: I2fea54bd662ade827ab2cc443b12f9dd6a67d09d
2014-08-30 18:52:58 +02:00
Roger Luethi
49e43b74c6 labs: rename local vars: boot libs
Make local variables lowercase and some of them more descriptive.

Change-Id: I05ef2562c2f4ff4e4a08b54719d70938dd54bacd
2014-08-30 18:52:27 +02:00
Jenkins
d5a7260c7d Merge "labs: pass VM_NAME as an argument" 2014-08-30 16:29:35 +00:00
Jenkins
131121e389 Merge "labs: remove redundant local declaration" 2014-08-30 16:28:05 +00:00
Jenkins
a689af368c Merge "labs: fix name for local variable declaration" 2014-08-30 16:27:43 +00:00
Roger Luethi
10f61aecd3 labs: rename local vars: virtualbox.install_base
Make local variables lowercase and some of them more descriptive.

Change-Id: Ie8e5af84047390c0b93d850f3c0c0323caff3228
2014-08-30 16:46:25 +02:00
Roger Luethi
a89db3ec97 labs: pass VM_NAME as an argument
Don't pass VM_NAME via environment variable to vbox_kbd_escape_key and
vbox_kbd_enter_key. Use an argument instead.

Change-Id: I7714f52ab4f80a83595e052974258e9f2e597435
2014-08-30 16:18:44 +02:00
Roger Luethi
e604cec100 labs: remove redundant local declaration
Fix one instance where a variable was declared local twice.

Change-Id: I1d354b71f9d6f4bb53f67e2c96a280069195b131
2014-08-30 12:27:41 +02:00
Roger Luethi
89edeb8044 labs: fix name for local variable declaration
Fix one instance where the variable name that was declared local
differed from the variable name actually used in the code.

Change-Id: Iee56ab527291a1c70455f7cc8fbd7316e29b1611
2014-08-30 12:26:35 +02:00
Roger Luethi
5c5994b258 labs: always init local variable
Local variable LINE was not initialized (but still used in a log call)
if disk_registered returned false. Fixed.

Change-Id: Icd679b2e50fd0d11fb5689d5806a016ac8043f7f
2014-08-30 12:22:45 +02:00
Roger Luethi
0237dbdc0d labs: osbash.sh options: drop -f, add -b
Add a -b option for building node VMs. This should make it harder for
users to accidentally overwrite their existing VMs.

It also allows us to drop the rather confusing "-f" option; "-w" without
"-b" is fast now, because no local building is ordered. To build node
VMs locally and Windows batch files at the same time, "-b -w" (or "-bw")
can be used.

Change-Id: I17ec78c0625f3657adaf670b7d58f2e4fde2248b
2014-08-27 13:53:50 +02:00
Roger Luethi
073e2f1a98 labs: add snapshot_cycle command
This changeset adds the new command, snapshot_cycle. It can be used to
replace four lines that often go together. The command handles a full
cycle needed for a snapshot: queueing shutdown.sh, booting the VM,
waiting for it to shutdown, and taking a snapshot.

Change-Id: I13276088bd44326f475bf7477ad2ed27db2dbbe9
2014-08-26 19:29:56 +02:00
Roger Luethi
82689fcae3 labs: add option for VM gui type
This changeset adds an environment variable and an option that can be
used to change the type of VirtualBox VM GUI used while building the
nodes.

Valid values are gui (default), sdl (minimal gui), and headless.

The resulting node VMs can then be started with or without GUI as
before.

Change-Id: If12f4ba6dc455972b6332318ed1261e2c9de8c3f
2014-08-26 19:29:56 +02:00
Roger Luethi
f210af6952 labs: add export via clone VM directory
This changeset introduces a new export method: exporting the named node
VMs as clones to the img directory.

The -e option takes now an argument (ova or dir) to distinguish between
exporting to an OVA package file and exporting to the img directory.

Unlike the OVA package files, this method preserves snapshots.

The resulting vbox files can be imported as VMs via VirtualBox GUI
(Machine->Add).

Change-Id: I7a8801de4b69796f3291a9e3a5896a055859121f
2014-08-26 19:29:56 +02:00
Roger Luethi
8e697a119b labs: move VM export function from osbash.sh into lib
This patch moves export_appliance in osbash.sh to vm_export_ova in
virtualbox.functions.

Change-Id: I80178fe647f1e76a2790b319a0abacd39428a9e0
2014-08-26 19:29:56 +02:00
Roger Luethi
c474a3a671 labs: reattach shared dirs after export
Shared directories are removed when exporting VMs to an OVA file. This
patch reattaches the shared directories after the VMs haven been
exported.

Change-Id: I3527aac6958df906e2aac8d95744b2362e8660f9
2014-08-25 13:04:18 +02:00
Jenkins
c13e0d6714 Merge "labs: reduce rm call verbosity" 2014-08-25 06:07:12 +00:00
Roger Luethi
84e898b620 labs: comments for get_vb_version
Add some comments to get_vb_version.

Change-Id: I049a82956674544a0096fcadf5e23120c076672f
2014-08-24 20:42:37 +02:00
Roger Luethi
c16eeebfd3 labs: reduce rm call verbosity
The verbose flag for one rm use was once useful for debugging, but now
just screws up the osbash.sh output. This patch removes the flag.

Change-Id: I4f91bdb1d4406f3fb03b6de43bdfc91ce6405043
2014-08-24 20:41:28 +02:00
Jenkins
52c4ee71fc Merge "labs: skip guestadditions for ssh install" 2014-08-24 10:16:47 +00:00
Roger Luethi
125e72e299 labs: fix guest-additions download
If the VirtualBox guest-additions have to be downloaded from the
Internet (usually they are provided by VirtualBox or already on the
disk), osbash fails to find the ISO image immediately -- it needs to
be restarted for that.

With this patch, osbash will correctly detect a freshly downloaded ISO
image.

Change-Id: Id767525cb25a2953e32ca5cba95fedddcdab6a5e
Implements: blueprint openstack-training-labs
2014-08-24 11:41:38 +02:00
Roger Luethi
d3dcf2e33d labs: skip guestadditions for ssh install
When building an ssh basedisk, there is no need to find and attach the
VirtualBox guest-additions.

Change-Id: I7da729596e3aa6a3000fd10046ee986929b03084
Implements: blueprint openstack-training-labs
2014-08-24 10:51:49 +02:00
Jenkins
5ebbffd351 Merge "labs: add init_node command" 2014-08-20 11:42:43 +00:00
Jenkins
1a3228d175 Merge "labs: explain host/VM script interaction" 2014-08-20 11:41:06 +00:00
Roger Luethi
b00fdddbe1 labs: explain host/VM script interaction
This patch adds a few comments to help the reader understand how host
(osbash, wbatch) scripts and VM scripts interact.

Change-Id: I1dd07d131877200d65664ab98c39d621df3e3604
Implements: blueprint openstack-training-labs
2014-08-20 13:24:51 +02:00
Roger Luethi
695d95dc3e labs: Update Ubuntu 14.04 -> 14.04.1
Update the ISO_URL for the new Ubuntu point release.

Change-Id: I81e70f929d0348f0f91b6381a70f6919b48983c5
Implements: blueprint openstack-training-labs
2014-08-20 13:21:30 +02:00
Roger Luethi
7e1864c7ba labs: add init_node command
This changeset adds a new init_node command for config/scripts.* and
uses it to merge scripts.nodeinit_osbash and scripts.nodeinit_vagrant
into the node specific config/scripts.*.

This results in some redundancy, but it (hopefully) makes the script
configuration easier to follow. It also makes the initial creation and
configuration of the VM just another step that can be picked or omitted
from script configuration.

Implements: blueprint openstack-training-labs
Change-Id: Ieadfe2b9540710556100051723e3e6f08855efa3
2014-08-20 13:02:29 +02:00