Skip to content

Commit 66cded7

Browse files
committed
Move Devcloud4 into main repository
1 parent da233c7 commit 66cded7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2570
-1
lines changed

tools/devcloud4/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
tmp
2+
cookbooks
3+
*.lock
4+
.vagrant

tools/devcloud4/README.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Devcloud 4
2+
3+
## Introduction
4+
5+
The follow project aims to simplify getting a full Apache CloudStack environment running on your machine. You can either take the easy ride and run `vagrant up` in either one of the 'binary installation' directories or compile CloudStack yourself. See for instructions in the 'basic' and 'advanced' directories.
6+
7+
The included VagrantFile will give you:
8+
9+
- Management
10+
- NFS Server
11+
- MySQL Server
12+
- Router
13+
- * Cloudstack Management Server * (Only given in binary installation)
14+
15+
- XenServer 6.2
16+
17+
## Getting started
18+
19+
1. Due to the large amount of data to be pulled from the Internet, it's probably not a good idea to do this over WiFi or Mobile data.
20+
21+
1. Given the amount of virtual machines this brings up it is recommended you have atleast 8gb of ram before attempting this.
22+
23+
1. Ensure your system has `git` installed.
24+
25+
1. When on Windows, make sure you've set the git option `autocrlf` to `false`:
26+
27+
```
28+
git config --global core.autocrlf false
29+
```
30+
31+
1. Clone the repository:
32+
33+
```
34+
git clone https://github.com/imduffy15/devcloud4.git
35+
```
36+
37+
1. Download and Install [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
38+
39+
On Windows7, the Xenserver VM crashed immediately after booting with a General Protection Fault.
40+
Installing VirtualBox version 4.3.6r91406 (https://www.virtualbox.org/wiki/Download_Old_Builds_4_3) fixed the problem, but only downgrade if the latest version does not work for you.
41+
42+
1. Download and install [Vagrant](https://www.vagrantup.com/downloads.html)
43+
44+
1. Ensure all Vagrant Plugins are installed:
45+
46+
```bash
47+
vagrant plugin install vagrant-berkshelf vagrant-omnibus
48+
```
49+
50+
1. Download and install [ChefDK](https://downloads.chef.io/chef-dk/)
51+
52+
### Configure virtualbox
53+
54+
1. Open virtualbox and navigate to its preferences/settings window.
55+
56+
1. Click onto the network tab and then onto the host only network tab.
57+
58+
1. Configure your adapters as follows:
59+
60+
- On Windows, the adapternames are different, and map as follows:
61+
- vboxnet0: VirtualBox Host-Only Ethernet Adapter
62+
- vboxnet1: VirtualBox Host-Only Ethernet Adapter 2
63+
- vboxnet2: VirtualBox Host-Only Ethernet Adapter 3
64+
65+
#### For Basic Networking you only need:
66+
67+
##### vboxnet0
68+
- IPv4 IP address of 192.168.22.1
69+
- Subnet of 255.255.255.0
70+
- DHCP server disabled
71+
72+
#### For Advanced Networking you will need:
73+
74+
75+
76+
##### vboxnet1
77+
- IPv4 IP address of 192.168.23.1
78+
- Subnet of 255.255.255.0
79+
- DHCP server disabled
80+
81+
82+
83+
##### vboxnet2
84+
- IPv4 IP address of 192.168.24.1
85+
- Subnet of 255.255.255.0
86+
- DHCP server disabled
87+
88+
## Defaults
89+
90+
### Management Server
91+
92+
- IP: 192.168.22.5
93+
- Username: vagrant or root
94+
- Password: vagrant
95+
96+
### Hypervisor
97+
98+
- IP: 192.168.22.10
99+
- Username: root
100+
- Password: password
101+

tools/devcloud4/advanced/Berksfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
source "https://api.berkshelf.com"
21+
22+
cookbook 'hostname'
23+
cookbook 'selinux'
24+
cookbook 'nat-router', git: 'http://github.com/imduffy15/cookbook_nat-router'
25+
cookbook 'cloudstack', git: 'https://github.com/imduffy15/cookbook_cloudstack-1'
26+
cookbook 'development-installation', path: '../common/development-installation'
27+
cookbook 'python', git: 'https://github.com/imduffy15/python.git'

tools/devcloud4/advanced/README.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
### Configure virtualbox
2+
3+
1. Open virtualbox and navigate to its preferences/settings window.
4+
5+
1. Click onto the network tab and then onto the host only network tab.
6+
7+
1. Configure your adapters as follows:
8+
9+
##### vboxnet0
10+
- IPv4 IP address of 192.168.22.1
11+
- Subnet of 255.255.255.0
12+
- DHCP server disabled
13+
14+
##### vboxnet1
15+
- IPv4 IP address of 192.168.23.1
16+
- Subnet of 255.255.255.0
17+
- DHCP server disabled
18+
19+
##### vboxnet2
20+
- IPv4 IP address of 192.168.24.1
21+
- Subnet of 255.255.255.0
22+
- DHCP server disabled
23+
24+
25+
### Start the vagrant boxes
26+
27+
```bash
28+
vagrant up
29+
```
30+
31+
*** Common issues: ***
32+
33+
- 'Cannot forward the specified ports on this VM': There could be MySQL or some other
34+
service running on the host OS causing vagrant to fail setting up local port forwarding.
35+
36+
37+
### Start Cloudstack
38+
39+
1. Clone the Cloudstack Repository:
40+
41+
```
42+
git clone https://github.com/apache/cloudstack.git
43+
```
44+
45+
*** Note: ***
46+
47+
Personally I prefer to use the 4.3 codebase rather than master. If you wish to do the same:
48+
49+
```
50+
git reset --hard 0810029
51+
```
52+
53+
1. Download vhd-util:
54+
55+
```bash
56+
cd /path/to/cloudstack/repo
57+
wget http://download.cloud.com.s3.amazonaws.com/tools/vhd-util -P scripts/vm/hypervisor/xenserver/
58+
chmod +x scripts/vm/hypervisor/xenserver/vhd-util
59+
```
60+
61+
1. Compile Cloudstack:
62+
63+
```bash
64+
cd /path/to/cloudstack/repo
65+
mvn -P developer,systemvm clean install -DskipTests=true
66+
```
67+
68+
1. Deploy Cloudstack Database:
69+
70+
```bash
71+
cd /path/to/cloudstack/repo
72+
mvn -P developer -pl developer,tools/devcloud4 -Ddeploydb
73+
```
74+
75+
1. Start Cloudstack:
76+
77+
```bash
78+
cd /path/to/cloudstack/repo
79+
mvn -pl :cloud-client-ui jetty:run
80+
```
81+
82+
1. Install Marvin:
83+
84+
```
85+
cd /path/to/cloudstack/repo
86+
pip install tools/marvin/dist/Marvin-0.1.0.tar.gz
87+
```
88+
89+
1. Deploy:
90+
91+
```
92+
python -m marvin.deployDataCenter -i marvin.cfg
93+
```
94+
95+
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one
5+
# or more contributor license agreements. See the NOTICE file
6+
# distributed with this work for additional information
7+
# regarding copyright ownership. The ASF licenses this file
8+
# to you under the Apache License, Version 2.0 (the
9+
# "License"); you may not use this file except in compliance
10+
# with the License. You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing,
15+
# software distributed under the License is distributed on an
16+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
# KIND, either express or implied. See the License for the
18+
# specific language governing permissions and limitations
19+
# under the License.
20+
#
21+
22+
VAGRANTFILE_API_VERSION = '2'
23+
24+
Vagrant.require_version '>= 1.5.0'
25+
26+
unless Vagrant.has_plugin?('vagrant-berkshelf')
27+
raise 'vagrant-berkshelf is not installed!'
28+
end
29+
30+
unless Vagrant.has_plugin?('vagrant-omnibus')
31+
raise 'vagrant-omnibus is not installed!'
32+
end
33+
34+
xenserver_networking_script = File.join(File.dirname(__FILE__), '../common/', 'configure-network.sh')
35+
36+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
37+
38+
config.vm.define 'xenserver' do |xenserver|
39+
xenserver.vm.box = 'duffy/xenserver'
40+
41+
# Public Network (IP address is ignored.)
42+
xenserver.vm.network :private_network, :auto_config => false, :ip => '192.168.23.10'
43+
44+
# Guest Network (IP address is ignored.)
45+
xenserver.vm.network :private_network, :auto_config => false, :ip => '192.168.24.10'
46+
47+
# Configure Interfaces
48+
49+
## Configure Management Interface
50+
xenserver.vm.provision 'shell' do |s|
51+
s.path = xenserver_networking_script
52+
s.args = %w(eth1 192.168.22.10 255.255.255.0 MGMT)
53+
end
54+
55+
## Configure Public Interface
56+
xenserver.vm.provision 'shell' do |s|
57+
s.path = xenserver_networking_script
58+
s.args = %w(eth2 na na PUBLIC)
59+
end
60+
61+
## Configure Guest Interface
62+
xenserver.vm.provision 'shell' do |s|
63+
s.path = xenserver_networking_script
64+
s.args = %w(eth3 na na GUEST)
65+
end
66+
67+
## Tweak kernel
68+
xenserver.vm.provision "shell", inline: "sed -i -e 's/net.bridge.bridge-nf-call-iptables = 1/net.bridge.bridge-nf-call-iptables = 0/g' -e 's/net.bridge.bridge-nf-call-arptables = 1/net.bridge.bridge-nf-call-arptables = 0/g' /etc/sysctl.conf && /sbin/sysctl -p /etc/sysctl.conf"
69+
70+
## Map host only networks and the adapters
71+
xenserver.vm.provider 'virtualbox' do |v|
72+
v.customize ['modifyvm', :id, '--nicpromisc2', 'allow-all']
73+
v.customize ['modifyvm', :id, '--nicpromisc3', 'allow-all']
74+
v.customize ['modifyvm', :id, '--nicpromisc4', 'allow-all']
75+
v.customize ['modifyvm', :id, '--hostonlyadapter2', 'vboxnet0']
76+
v.customize ['modifyvm', :id, '--hostonlyadapter3', 'vboxnet1']
77+
v.customize ['modifyvm', :id, '--hostonlyadapter4', 'vboxnet2']
78+
v.customize ["modifyvm", :id, '--nictype2', 'Am79C973']
79+
v.customize ["modifyvm", :id, '--nictype3', 'Am79C973']
80+
v.customize ["modifyvm", :id, '--nictype4', 'Am79C973']
81+
end
82+
end
83+
84+
config.vm.define 'management' do |management|
85+
management.vm.box = 'chef/centos-6.5'
86+
87+
# Configure management interface
88+
management.vm.network :private_network, :auto_config => true, :ip => '192.168.22.5'
89+
90+
# Configure public interface
91+
management.vm.network :private_network, :auto_config => true, :ip => '192.168.23.5'
92+
93+
# Port forward MySQL
94+
management.vm.network 'forwarded_port', guest: 3306, host: 3306
95+
96+
management.vm.provider 'virtualbox' do |v|
97+
v.customize ['modifyvm', :id, '--memory', 512]
98+
v.customize ['modifyvm', :id, '--hostonlyadapter2', 'vboxnet0']
99+
v.customize ['modifyvm', :id, '--hostonlyadapter3', 'vboxnet1']
100+
v.customize ["modifyvm", :id, '--nictype2', 'Am79C973']
101+
v.customize ["modifyvm", :id, '--nictype3', 'Am79C973']
102+
end
103+
104+
management.omnibus.chef_version = "11.16.4"
105+
management.berkshelf.berksfile_path = File.join(File.dirname(__FILE__), 'Berksfile')
106+
management.berkshelf.enabled = true
107+
108+
CHEF_CONFIGURATION = JSON.parse(Pathname(__FILE__).dirname.join('chef_configuration.json').read)
109+
110+
management.vm.provision 'chef_solo' do |chef|
111+
chef.run_list = CHEF_CONFIGURATION.delete('run_list')
112+
chef.json = CHEF_CONFIGURATION
113+
end
114+
end
115+
end
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"run_list": [
3+
"recipe[development-installation]",
4+
"recipe[nat-router]"
5+
],
6+
"iptables": {
7+
"lans": ["eth1", "eth2"]
8+
},
9+
"set_fqdn": "*.localdomain",
10+
"selinux": {
11+
"state": "permissive"
12+
},
13+
"cloudstack": {
14+
"secondary": {
15+
"path": "/exports/secondary"
16+
},
17+
"primary": {
18+
"path": "/exports/primary"
19+
},
20+
"hypervisor_tpl": {
21+
"xenserver": "http://jenkins.buildacloud.org/job/build-systemvm64-master/lastSuccessfulBuild/artifact/tools/appliance/dist/systemvm64template-master-4.6.0-xen.vhd.bz2"
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)