README.md 3.56 KB
Newer Older
1 2

# Circle Project Salt Installer
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

## Install Salt

```bash
sudo add-apt-repository ppa:saltstack/salt
sudo apt-get update
sudo apt-get install salt-minion
```

## Configure salt
Open the salt minion configuration

```bash
sudo vim /etc/salt/minion
```

Add these lines:

```bash
file_client: local

file_roots:
  base:
    - /home/cloud/salt/salt

pillar_roots:
  base:
    - /home/cloud/salt/pillar
```
## Get the installer
Clone circle installer git repository into cloud home

```bash
git clone git@git.ik.bme.hu:circle/salt.git
```

## Change variables
Modify installer.sls file

```
sudo vim salt/pillar/installer.sls
```

Most used variables

* **admin_user**: user name to login in as admin on the site
* **admin_pass**: password to login in as admin on the site
* time zone: the server's time zone, format is region/city
* nfs
	* server: nfs server's hostname
	* network: nfs server's network to access files
	* directory: this directory will be shared
* storagedriver:
	* **queue_name**<sup>*</sup>: storage host name
* fwdriver
	* **queue_name**<sup>*</sup>: the server's hostname
	* **gateway**<sup>*</sup>: the server's gateway
	* **external_net**<sup>*</sup>: the server's network
	* **external_if**: the server's network interface

> <sup>**`*`**</sup> These variables need to be configured. Use `hostname`, `ifconfig`, `route -n` to get network information.

## Install Circle
Run the following installation command:

```bash
sudo salt-call state.sls allinone
```

72 73 74 75 76 77
After install, delete agent.conf file:

```bash
sudo rm /etc/init/agent.conf
```

78
### Current problems 
79

80
#### Gateway issue
81 82 83 84 85 86 87 88
```
cd circle/circle/
workon circle
./manage.py firewall_restart

# get eth0 MAC address
ifconfig
sudo -i
89
ip netns exec fw bash
90 91 92
ifconfig net hw ether <MAC>
```

93
#### Nginx issue
94 95 96 97 98 99 100 101 102 103 104 105 106 107
	Delete configuration file duplication and restart nginx
```
sudo rm /etc/nginx/sites-enabled/default
sudo service nginx restart
```

#### Open firewall
```
sudo ufw allow 443
sudo ufw allow 80
```

## Quickstart - Standalone Node

108
### Login
109 110 111 112 113
Log in into the Circle website with admin (the site is accessable on the 443 port). Name and password is in the `salt/pillar/installer.sls`.

### Create Node
To run virtual machines, we need to create nodes - and add to the system. Click on the new icon in the dashboard, Nodes menu.

114
#### Configure Node
115 116 117

To standalone configuration, type the current machine's hostname to Host/name, MAC address to Host/MAC, IP to HOST/IP. Choose managed-vm as VLAN.

118
#### Activate Node
119 120 121 122 123 124 125 126 127 128 129 130

Click on the 'Activate' icon to use the Node.

### Start Virtual Machine

To create new Virtual Machine, we use Templates - images based on previously saved VMs. Currently we haven't got any template - so let's create a new one. Click on Templates/new icon and choose 'Create a new base VM without disk'.

#### Configure Template

Set name, CPU and RAM settings, architecture. Check in the boot menu box, select network and lease, write down, which operating system will you use. Finally, create a template.
> The rows marked with astersk need to be filled.

131
![configure standalone node](docs/images/configure_node.jpg)
132 133 134 135

#### Add disk

Currently we don't have any disks attached to our VM. To add, click on the Resources menu, 'create disk' icon, set the name and size.
136
![disk setup](docs/images/disk.jpg)
137 138 139 140

#### Attach ISO

To install an OS, we can use ISO images, to boot from. Click on 'download disk' and type the ISO's URL.
141
![download iso](docs/images/iso.jpg)
142

143
### Start Virtual Machine
144 145
Finally, we can run the machine. Click on 'deploy' and start it. You can choose, on which node do you want to run.

146
![ubuntu 14.04](docs/images/ubuntu.png)