Revision f6822a26 docs/examplesdir/network.rst
b/docs/examplesdir/network.rst | ||
---|---|---|
3 | 3 |
|
4 | 4 |
Users can create private networks between Virtual Machines. |
5 | 5 |
|
6 |
In the following we assume that there are two active VMs (ids 141 and 142)
|
|
7 |
connected to one public network with id 1 (default set up). |
|
6 |
In the following we assume that there are two active virtual servers (ids 141
|
|
7 |
and 142) connected to one public network with id 1 (default set up).
|
|
8 | 8 |
|
9 | 9 |
.. code-block:: console |
10 | 10 |
|
... | ... | |
24 | 24 |
network_id: 1 |
25 | 25 |
$ |
26 | 26 |
|
27 |
.. note:: In Synnefo, each VM connects to a network through a NIC. The id of a
|
|
28 |
nic is nic-<server id>-<increment> by convention.
|
|
27 |
.. note:: In Synnefo, each virtual server connects to a network through a nic.
|
|
28 |
The id of a nic is *nic-<server id>-<increment>* by convention.
|
|
29 | 29 |
|
30 | 30 |
Let's load kamaki for networks and have a look at the current network state. We |
31 | 31 |
expect to find at least one public network (id: 1) |
... | ... | |
71 | 71 |
user_id: s0m3-u53r-1d |
72 | 72 |
[network]: |
73 | 73 |
|
74 |
Let's create two more networks, one for VM 141 and one for Vm 142 |
|
74 |
Let's create two more networks, one for virtual server 141 and one for virtual |
|
75 |
server 142 |
|
75 | 76 |
|
76 | 77 |
.. code-block:: console |
77 | 78 |
|
78 |
[network]: create 'For VM 141'
|
|
79 |
[network]: create 'For virtual server 141'
|
|
79 | 80 |
... |
80 | 81 |
id: 4 |
81 | 82 |
... |
82 |
[network]: create 'For VM 142'
|
|
83 |
[network]: create 'For virtual server 142'
|
|
83 | 84 |
... |
84 | 85 |
id: 5 |
85 | 86 |
... |
... | ... | |
88 | 89 |
Connect and disconnect |
89 | 90 |
---------------------- |
90 | 91 |
|
91 |
To make a points, the networks should be connected to their respecting VMs |
|
92 |
To make a point, the networks should be connected to their respecting virtual |
|
93 |
servers |
|
92 | 94 |
|
93 | 95 |
.. code-block:: console |
94 | 96 |
|
... | ... | |
97 | 99 |
[network]: |
98 | 100 |
|
99 | 101 |
Now, let's check the current network state. We expect to see the servers |
100 |
connected to netowkrd with ids 4 and 5, but not 3.
|
|
102 |
connected to networks with ids 4 and 5, but not 3.
|
|
101 | 103 |
|
102 | 104 |
.. code-block:: console |
103 | 105 |
|
... | ... | |
133 | 135 |
type: MAC_FILTERED |
134 | 136 |
updated: 2013-06-19T13:54:57.672744+00:00 |
135 | 137 |
user_id: s0m3-u53r-1d |
136 |
4 For VM 141
|
|
138 |
4 For virtual server 141
|
|
137 | 139 |
attachments: |
138 | 140 |
nic-141-1 |
139 | 141 |
cidr: 192.168.2.0/24 |
... | ... | |
148 | 150 |
type: MAC_FILTERED |
149 | 151 |
updated: 2013-06-19T13:54:57.672744+00:00 |
150 | 152 |
user_id: s0m3-u53r-1d |
151 |
5 For VM 142
|
|
153 |
5 For virtual server 142
|
|
152 | 154 |
attachments: |
153 | 155 |
nic-141-2 |
154 | 156 |
cidr: 192.168.3.0/24 |
... | ... | |
165 | 167 |
user_id: s0m3-u53r-1d |
166 | 168 |
[network]: |
167 | 169 |
|
168 |
It is time to make meaningful connections: connect two servers to a private
|
|
170 |
It is time to make a meaningful connection: connect two servers to a private
|
|
169 | 171 |
network |
170 | 172 |
|
171 | 173 |
.. code-block:: console |
... | ... | |
174 | 176 |
[network]: connect 142 3 |
175 | 177 |
[network]: |
176 | 178 |
|
177 |
Now the servers can communicate with eachother through their shared private |
|
179 |
Now the servers can communicate with each other through their shared private
|
|
178 | 180 |
network. Let's see the network details to confirm that |
179 | 181 |
|
180 | 182 |
.. code-block:: console |
... | ... | |
213 | 215 |
|
214 | 216 |
.. warning:: Public networks cannot be destroyed in Synnefo |
215 | 217 |
|
216 |
Attempt to destroy the useless `For VM 141` network
|
|
218 |
Attempt to destroy the useless `For virtual server 141` network
|
|
217 | 219 |
|
218 | 220 |
.. code-block:: console |
219 | 221 |
|
... | ... | |
221 | 223 |
(403) Network with id 4 is in use |
222 | 224 |
[network]: |
223 | 225 |
|
224 |
The attached VMs should be disconnected first (recall that the nic-141-1
|
|
225 |
connects network with id 4 to VM with id 141)
|
|
226 |
The attached virtual servers should be disconnected first (recall that the
|
|
227 |
nic-141-1 connects network with id 4 to virtual server with id 141)
|
|
226 | 228 |
|
227 | 229 |
.. code-block:: console |
228 | 230 |
|
... | ... | |
237 | 239 |
|
238 | 240 |
[network]: disconnect nic-142-2 |
239 | 241 |
[network]: disconnect nic-141-2 |
240 |
(404) No nic nic-141-2 on server(VM) with id 141
|
|
241 |
| * check server(VM) with id 142: /server info 141
|
|
242 |
| * list nics for server(VM) with id 141:
|
|
242 |
(404) No nic nic-141-2 on server(virtual server) with id 141
|
|
243 |
| * check server(virtual server) with id 142: /server info 141
|
|
244 |
| * list nics for server(virtual server) with id 141:
|
|
243 | 245 |
| /server addr 141 |
244 | 246 |
| Network Interface nic-141-2 not found on server 141 |
245 | 247 |
[network]: |
246 | 248 |
|
247 | 249 |
Strangely, kamaki did not find any nic-141-2 nics. Why? |
248 | 250 |
|
249 |
Answer: A listing of the 141 nics shows that the network connection to network
|
|
250 |
with id 3 is now renamed as nic-141-1
|
|
251 |
Answer: Get the addresses of server 141 to find out that the nic which connects
|
|
252 |
the server to network 3 is automatically renamed (nic-141-2 --> nic-141-1)
|
|
251 | 253 |
|
252 | 254 |
.. code-block:: console |
253 | 255 |
|
... | ... | |
266 | 268 |
network_id: 1 |
267 | 269 |
[network]: |
268 | 270 |
|
269 |
.. warning:: Synnefo network server renames the nics of a VM whenever another
|
|
270 |
nic is of the same server is deleted
|
|
271 |
.. warning:: Synnefo network server may rename the nics of a virtual server if
|
|
272 |
another nic on the same server is deleted
|
|
271 | 273 |
|
272 | 274 |
Let's remove the correct nic, then, and check if any other nics are related to |
273 | 275 |
the network with id 3. |
Also available in: Unified diff