186 Commits

Author SHA1 Message Date
Ian Southam
98a43d184b Fixed bug in which every run of loadQueueFile would append to the json file (merge)
cloud-early-config now saves its input file to /var/cache/cloud
Execute load cmd_line.json in update_config
Old way of working still in there to stop and possible clash until the base image is made
2015-03-16 11:35:19 +01:00
Ian Southam
680454dfdf Some bug fixes
Some more tests
store vmpassword functionally working
Tests for store password
2015-03-16 11:35:18 +01:00
Ian Southam
9d73879061 Fixed test (assert in guest check was wrong way around)
Also found condition inw hich apache would be miscobfigured and failed to run (I love tests!!)
Fixed configure.py to cover this case
Added a test to provoke this case!
2015-03-16 11:35:18 +01:00
Ian Southam
4c5f4a1f9f Added vmpassword type (does nothing yet)
Fixed tests to use /var/cache/cloud
Added some test files but will remove them when tests are properly completed
Fixed a bug in configure that did not deal well with databags with empty dev sections
2015-03-16 11:35:17 +01:00
Hugo Trippaers
6a016d5b54 Small fixes 2015-03-16 11:35:17 +01:00
Hugo Trippaers
85434f49b9 Hotfix for lost control interface 2015-03-16 11:35:17 +01:00
Hugo Trippaers
58919dcf50 Change the location for the temporary json files to /var/cache/cloud 2015-03-16 11:35:16 +01:00
Ian Southam
ca2ff2946e Added some tests that test stuff
Specifically checking whether certain ip addresses get added and deleted
Also a rudementary test for the guest network ip
Much more to do!!
2015-03-16 11:35:16 +01:00
Ian Southam
c428d60e6b Stop ignoring eth0 2015-03-16 11:35:15 +01:00
Ian Southam
dd6b643ceb Do not use eth0 or eth1 for random tests
One or other will be the control interface of the box
2015-03-16 11:35:15 +01:00
Ian Southam
cc5d72133e Removed chef as we will definitely not go this way 2015-03-16 11:35:14 +01:00
Ian Southam
6a7a832ef5 iDo not do the post configure steps on a control interface 2015-03-16 11:35:14 +01:00
Ian Southam
2aed586bfc Removed merge_cline - no longer required
Added the last pieces of vpc guest network
password server and associated FW rules
Added apache2 config and start of server
Corrected a bug in CsFile
Fixed some of the many pyLint bleats
2015-03-16 11:35:13 +01:00
Leo Simons
295e2caff0 Fix configure::waitForDevice when a device is missing.
Was using non-existing 'ip' variable.
2015-03-16 11:35:12 +01:00
Leo Simons
cf4cdde291 Fix update_config.py use of subprocess. 2015-03-16 11:35:12 +01:00
Leo Simons
6244265de0 Fancy line editor for Ian 2015-03-16 11:35:11 +01:00
Ian Southam
05702ecd1a Added guest network configuration
Added iptables config (adds but no deletes yet)
Apache config (VPC GN)
DNSMasq config (VPX GN)
2015-03-16 11:35:10 +01:00
Ian Southam
666dc16e58 Moved bag location to /et/cloudstack
Updated test script to also process command line
Added connmark stuff to merge
2015-03-16 11:35:09 +01:00
Ian Southam
2a94ca69ce Added some lost lines back using Hugo witchcraft 2015-03-16 11:35:09 +01:00
Ian Southam
ca4887d9cc Test data for ipassociation
These files emulate commands coming from cloudstack itself
2015-03-16 11:35:08 +01:00
Ian Southam
c7c1f3202e Plan B
Replace chef with a python script
configure.py will read the bags and (hopefully) create the desired state
At this stage this is ipassociation
This code should work for both VR and VPCrs

TODO:
iptables
ip route throw (present in VR but not in VPCr
Determine default route
Unit tests
2015-03-16 11:35:08 +01:00
Ian Southam
3811b8dc90 Split Databag in to separate class as I would now need this 2015-03-16 11:35:06 +01:00
Ian Southam
3077eb925b Include the guestnetwork code
This takes the guestnetwork object and also creates an ip object
2015-03-16 11:35:06 +01:00
Ian Southam
9355dd7133 Corrected a hole in my logic 2015-03-16 11:35:05 +01:00
Ian Southam
0bf7d54722 1. Completed provider for ip rules (fwmark)
2.  Added merge routine for guestnetwork config messages
3.  Updated test script
2015-03-16 11:35:05 +01:00
Hugo Trippaers
583f177619 Disable cmdline check until it's fixed 2015-03-16 11:35:04 +01:00
Hugo Trippaers
0027db6cd1 Switch ip associations to new model and update the recipes 2015-03-16 11:35:04 +01:00
Ian Southam
0db157e58f Remove debug code 2015-03-16 11:35:04 +01:00
Ian Southam
d868b0521b Correct small typo in error message 2015-03-16 11:35:03 +01:00
Ian Southam
bcb760e1e2 Can now read the ips out of the cmdline databag (if present) 2015-03-16 11:35:03 +01:00
Ian Southam
0c8f8d945e Only ip_association files for now 2015-03-16 11:35:03 +01:00
Ian Southam
bcbefb2833 Changed from camelCase to json_case 2015-03-16 11:35:03 +01:00
Ian Southam
54b21220db Use json naming standards instead of camelCase 2015-03-16 11:35:02 +01:00
Ian Southam
018b56385c Added cs_ip module
Corrected syntax error in merge.py
2015-03-16 11:35:02 +01:00
Ian Southam
a357e12943 Add the Python bits 2015-03-16 11:35:02 +01:00
Ian Southam
72111c3399 Merged cookbooks from vpc branch 2015-03-16 11:35:01 +01:00
Hugo Trippaers
b596be1a82 Add a placeholder for the trigger file 2015-03-16 11:35:00 +01:00
Hugo Trippaers
7afd50d65a This file isn't used, so remove it 2015-03-16 11:34:59 +01:00
Ian Southam
5b82e2059d Cherry-pick of 11c00977f77f45aa7b0c387dc88360eba0819e8a:
----
Author:    Ian Southam <isoutham@schubergphilis.com>

First commit towards moving systemvm to chef based configuration
In this commit

1.  cmdline json databag is created
2.  ip association data bag is created
3.  Basic chef cookbook to manage ips and routes

Conflicts:
	systemvm/patches/debian/config/etc/init.d/cloud-early-config
	systemvm/patches/debian/config/var/chef/cookbooks/README
	tools/appliance/definitions/systemvm64template/postinstall.sh
----
Because we've refactored the systemvm template the change to
postinstall.sh now gets its own chef.sh file.
2015-03-16 11:34:59 +01:00
Rohit Yadav
375e998eaf CLOUDSTACK-8272: Python based file-lock free password server implementation
- VRs are single CPU, so Threading based implementation favoured than Forking based
- Implements a Python based password server that does not use file based locks
- Saving password mechanism is provided by using secure token only to VR (localhost)
- Old serve_password implementation is removed
- Runs with Python 2.6+ with no external dependencies
- Locks used within threads for extra safety

This closes #106

(cherry picked from commit 4b45d25152a6661fcd1796670f0fb65bb4a32df5)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-12 13:57:49 +05:30
René Moser
47de4a12f4 systemvm: correct sftp subsystem path of debian wheezy
This closes #104

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-10 10:15:05 +05:30
René Moser
37b4d9c308 systemvm: use Debian http redirector for apt repositories
* No offline mirrors
* No out of date mirrors
* New mirrors are used
* Load-balancing
* Faster downloads (when APT is used, via parallel downloads)
* Great on mobility

Also see http://http.debian.net/ for more information.

This closes #103

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-10 10:11:08 +05:30
Rohit Yadav
ebcad34d33 systemvm: avoid tcp responses with timestamp
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit f3f47f25bab8661f31e5d470995f6f24cc08310e)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-09 17:12:22 +05:30
Rohit Yadav
5256b0205a systemvm: have apache2 use secure SSL cipher suite
Created using Mozilla's ssl config generator:
https://mozilla.github.io/server-side-tls/ssl-config-generator/

Intermediate setting was used, with apache version 2.2.22 and openssl 1.0.1e
Oldest compatible clients:
Firefox 1, Chrome 1, IE 7, Opera 5, Safari 1, Windows XP IE8, Android 2.3, Java 7

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit ab8f367850c7ef75e1ff851397ff7dee4b5e40ab)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-03-09 12:45:06 +05:30
Jayapal
8414223a96 CLOUDSTACK-5494: Fixed dns is open to public in VR
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 81994cf443ca64aead822ed1b3cf1c22d10bd9fe)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-02-06 15:31:13 +05:30
Rohit Yadav
664186f483 CLOUDSTACK-8160: use preferable protocols
(cherry picked from commit debfcdef788ce0d51be06db0ef10f6815f9b563b)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-01-21 18:04:45 +05:30
Rohit Yadav
aae393dcd5 CLOUDSTACK-7974: remove old hostname entry for a VM when adding a VM
When adding a VM, it adds an entry to /etc/hosts file on the VR but does not
clear up any older entries for the VM with a same name. The fix uncomments the
command that removes any old entries in the VM.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 63298d9b742811919717ffd6303c8a2e9d37a3dd)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2014-12-10 18:25:22 +05:30
Remi Bergsma
ef3b4bb4e3 made iptables for the VPN connection more secure
Added destination and source definition. Flag -S can be used
to ignore this. It's the new default as it is more secure
and does not impact the way things work (backwords compatible).
2014-12-08 19:06:55 +01:00
Remi Bergsma
7f33f7c396 prevent CloudStack from removing the VPN connection
If connecting the VPN takes some time, for example because
the other end is not (yet) up, CloudStack will delete
the VPN because the ipsectunnel.sh does not return in time.
The VPN connection then enters the Error state.

This change makes sure ipsectunnel.sh returns in time,
and lets ipsec connect in the background. If it all fails,
the connection enters Disconnected.
2014-12-08 19:00:59 +01:00
Remi Bergsma
f8d718e3e3 add a flag -c whether or not to check the VPN on create
Changed default to no, as the other side may not be up yet.
If this check fails, the VPN enters Error state and will not
work. It's safe to just let it connect on its own so it will
connect when it can.
2014-12-08 18:59:16 +01:00