OSDN Git Service

improvement of restart process of fulcond service
[fulcon/Fulcon.git] / README.md
1 Fulcon / Slot-OS Platform 0.4    Copyright (C) 2015-2016 NIWA Hideyuki
2     Apache License Version 2.0
3
4 ## What is Fulcon/Slot-OS?
5
6 - Slot-OS divides the HOST machine into two or more software partitions (slot). 
7 - Each slot can be operated like another machine of the same composition. 
8 - Root of the Fulcon/Slot-OS container has a strong root authority, and the same operation as root of HOST is possible. 
9 - The slot can dynamically compose the network. (SDN function)
10
11 ## Function of Fulcon/Slot-OS
12 - Function to divide machine into two or more slots
13 - Function to generate image for slot from rootfs of HOST
14 - Dynamic addition and deletion (SDN) function of two or more Internet Protocol addresses
15 - Allocation of resource of each slot (CPU%, number of CPU, and memory size) and dynamic modification function
16 - Console function of slot
17 - Listing function of the entire slot
18 - Suspension (temporary stop) and resume of slot
19 - Automatic update-function of two or more slots
20 - High-speed backup function
21
22 Fulcon can handle CentOS 7, Ubuntu 15.04, 15.10, Fedora 23
23
24 ### Install package
25
26 ubuntu
27
28 $  sudo apt-get install docker.io python-ipy bridge-utils openvswitch-switch
29 $  sudo systemctl enable docker.service
30 $  sudo systemctl start docker.service
31 $  sudo dpkg -i fulcon_0.4_amd64.deb
32 $  sudo systemctl enable fulcon.service
33 $  sudo systemctl start fulcon.service
34
35 CentOS, Fedora
36
37 $  sudo yum install docker-io python-IPy bridge-utils openvswitch
38 $  sudo systemctl enable docker.service
39 $  sudo systemctl start docker.service
40 $  sudo rpm -ivh fulcon-0.4-1.el7.centos.x86_64.rpm
41 $  sudo systemctl enable fulcon.service
42 $  sudo systemctl start fulcon.service
43  
44 ### Building:
45
46 ubuntu
47
48 $  sudo apt-get install docker.io python-ipy bridge-utils openvswitch-switch
49 $  sudo systemctl enable docker.service
50 $  sudo systemctl start docker.service
51 $  tar xzf fulcon.tgz  
52 $  cd fulcon  
53 $  sudo make install  
54 $  sudo systemctl enable fulcon.service
55 $  sudo systemctl start fulcon.service
56   
57 CentOS, Fedora
58   
59 $  sudo yum install docker-io python-IPy bridge-utils openvswitch
60 $  sudo systemctl enable docker.service
61 $  sudo systemctl start docker.service
62 $  tar xzf fulcon.tgz  
63 $  cd fulcon  
64 $  sudo make install  
65 $  sudo systemctl enable fulcon.service
66 $  sudo systemctl start fulcon.service
67   
68 ### Setup:  
69
70 #### 1. Generation of OS image (make-base-image subcommand)
71
72 If the slot-os image has not been generated yet, the slot-os image is necessary as OS of slot. 
73 Rootfs for slot is generated from rootfs of HOST. 
74 It takes 50 minutes from ten minutes for generation. (Depend on the machine performance and the size of rootfs. )
75   
76 $  sudo fulcon make-base-image
77
78 #### 2. Making of Slot partition (build subcommand)
79 - HOST is divided into two or more slot. 
80 - The resource of Slot is automatically initialized. 
81   CPU% = (all CPU the number)*100% / (slot number) 
82   allocation CPU = all CPU the number
83   CPU MEMORY =  512MB
84 - When 0 is specified for a number of Slot, all slot is deleted. 
85
86 The following examples divide HOST into three. 
87
88 $ sudo Slot-OS build 3
89   
90 ### Using:  
91   
92 #### 3.The display the list of slot (list subcommand) 
93 The "list of slot" is displayed. 
94 Slot number, state, slot name, CPU%, CPU allocation, and memory size, 
95 autostart, image names, and Internet Protocol addresses
96
97 $ sudo slot-os list
98  0 : RUNNING  slot00 66 % 0-1 512m A Slot-OS 172.17.0.2
99  1 : STOPPED  slot01 66 % 0-1 512m - Slot-OS
100  2 : STOPPED  slot02 66 % 0-1 512m - Slot-OS
101
102 #### 4. Boot of slot (start subcommand)
103 All slot or of specify slot is booted by the number. 
104
105 The 0th slot is booted. 
106 $ sudo slot-os start 0
107 $ sudo slot-os list
108  0 : RUNNING  slot00 66 % 0-1 512m A Slot-OS
109  1 : STOPPED  slot01 66 % 0-1 512m - Slot-OS
110  2 : STOPPED  slot02 66 % 0-1 512m - Slot-OS
111
112 All slot is booted. 
113 $ sudo slot-os start all
114 $ sudo slot-os list
115  0 : RUNNING  slot00 66 % 0-1 512m A Slot-OS
116  1 : RUNNING  slot01 66 % 0-1 512m - Slot-OS
117  2 : RUNNING  slot02 66 % 0-1 512m - Slot-OS
118
119 #### 5. Console of Slot
120 The console of Slot number 0 is opened. 
121
122 $ sudo slot-os console 0
123
124 #### 6. Update and package application (update, update-prog, and update-deploy subcommand)
125
126 It is an automatic update as for the package of all slot. 
127
128 $ sudo slot-os update all
129
130 The package is copied under/root of all slot. 
131
132 $ sudo slot-os deploy all : perl-XML-Parser-2.41-8.el7.x86_64.rpm /root
133
134 The package copied with all slot is installed. 
135
136 $ sudo slot-os update-prog all : rpm -ivh /root/perl-XML-Parser-2.41-8.el7.x86_64.rpm
137
138 The package copied with all slot is deleted. 
139
140 $ sudo slot-os update-prog all : rm -f /root/perl-XML-Parser-2.41-8.el7.x86_64.rpm
141
142 #### 7. Stop and renewal of slot (start, stop, suspend, and resume subcommand)
143
144 Shutdown
145
146 $ sudo slot-os stop 0
147
148 Boot
149
150 $ sudo slot-os start 0
151
152 Temporary stop (suspension)
153
154 $ sudo slot-os suspend 0
155
156 Restart
157
158 $ sudo slot-os resume 0
159
160 #### 8. Backup and restoration of slot (backup and restore subcommand)
161
162 Backup of slot
163
164 $ sudo slot-os backup 0 bkup1
165
166 "bkup1" describes it on of putting on the backup name. Anything is good 
167 in the alphanumeric character. 
168 The backup image name is as follows. 
169 slot00.bkup1
170
171 Restoration of backup
172
173 $ sudo slot-os backup-restore 0 slot00.bkkup1
174
175 List of backup
176
177 $ sudo slot-os backup-list
178
179 The initialization of slot restores slot-os. 
180
181 $ sudo slot-os backup-restore 0 slot-os
182
183 #### 9. Dynamic addition and deletion of network (net-add and net-del subcommand)
184
185 When Slot is booted, the network of 172.17.0.0/16 is added. 
186 This Internet Protocol address changes at each boot. 
187 NAT setting of network of 172.17.0.0/16
188
189 Internet Protocol address is added. The address of 192.168.18.2/24 is added to 0 of 
190 Slot as the first NIC. 
191
192 $ sudo slot-os net-add 0 192.168.18.2/24 1
193
194 Addition of second NIC
195
196 $ sudo slot-os net-add 0 192.168.78.3/24 2
197
198 The state of NIC is displayed. 
199
200 $ sudo slot-os net-info
201 slot00  eth0            172.17.0.2/16
202 slot00  vgslot00_1      192.168.18.2/24
203 slot00  vgslot00_2      192.168.78.2/24
204
205 Internet Protocol address is deleted. 
206 IP of the second of Slot 0 are deleted. 
207
208 $ sudo slot-os net-del 0 2
209
210 #### 10. NIC of HOST is shared (net-nic-add and net-nic-del subcommand). 
211
212 Outside HOST and slot communicates sharing NIC of HOST. 
213 The NIC name of HOST : with ens7f1 for address 10.124.23.91/24. 
214
215 $ sudo slot-os net-nic-add ens7f1
216
217 It adds it to the third Slot 0 by 10.124.23.101/24. 
218
219 $ sudo slot-os net-add 0 10.124.23.101/24 3
220
221 It comes to be able to access slot 0 outside HOST by 10.124.23.101. 
222
223 NIC(ens7f1) of HOST is removed. 
224
225 $ sudo slot-os net-nic-del ens7f1
226
227
228 ### ALL Sub command:  
229 ```
230   
231 auotstart NAME [ on | off ] ( all | SLOT_NUMBER...)
232      NAME is started automatically at the time of a system restart.
233
234 backup NUMBER NEW_NAME
235      slot in NUMBER is backuped. A backup will be slotXX.NEW_NAME.
236
237 backup-del IMAGE_NAME
238      A backup of IMAGE_NAME is erased.
239
240 backup-list
241      A list of backups is indicated.
242
243 backup-restore SLOT_NUMBER BACKUP_IMAGE
244      backup image is restored in slot.
245
246 br-add BRIDGE_NUMBER ( IPADDR/MASK | NET_DEVICE ]
247      The IP-address or the device is registered in the bridge.
248   
249 br-del BRIDGE_NUMBER
250      The IP-address or the device is deleted in the bridge.
251   
252 br-info
253      Information on the bridge where NIC that adds it is connected is displayed.  
254   
255 build NUMBER
256      HOST is separated in NUMBER and slot is made.
257      When 0 is specified, all slot is erased.
258
259 list [ -c ] [ NAME ]
260      The list of the made slot is displayed.  
261      Display term is as follows.
262        NUM, Status, Container name, CPU%, CPUS, Memory, Autostart(A or -), Image name, IP address
263      -c 
264           It always keeps indicating list. When stopping, ^c is pushed.
265
266 help
267      Help is displayed.  
268
269
270 list [ SLOT_NUMBER ]
271      The list of the made slot is displayed.  
272
273 make-base-image
274      fulcon/slot-os image is generated from HOST.
275      It even takes tens of minutes for completion.
276
277 net-add SLOT_NUMBER IPADDR/MASK NIC_NUMBER 
278      NIC is added to the slot.   
279
280 net-del SLOT_NUMBER NIC_NUMBER
281      NIC is deleted from the slot.   
282
283 net-info [ NAME ]
284      Information on the network where NIC that adds it is connected is displayed.  
285
286
287 resource [-c CPU] [-n CPUSET] [-m MEM] ( all | NUMBER ... )
288      The resource allocated in the slot is displayed if there is no "-c, -n, -m" option.  
289      -c CPU  
290           The ratio of allocated CPU is % specified.   
291      -n CPUSET  
292           The allocated CPU number is specified.  
293      -m MEM  
294           The allocated memory size are specified.  
295           "M" and "G" can be used for the unit.  
296   
297
298 resume ( all | NUMBER ... )
299      Resume does the slot in the state of SUSPENDED by suspend.  
300
301 start ( all | NUMBER ... )
302      The slot of the specified NUMBER is started.  
303
304
305 stop ( all | NUMBER ... )
306      The slot of the specified NUMMBER is stopped.   
307
308
309 suspend ( all | NUMBER ... )
310      The NUMBER of the specified NUMBER is suspended.  
311
312
313 update ( all | NUMBER ...)
314      All slot os packages are updated.   
315      "Yum update" is done in centos. In ubuntu,   
316      "Apt-get update" and "Apt-get upgrade" are done.   
317
318
319 update-prog ( all | NUMBER ... ) : COMMAND
320      A COMMAND program for update is executed in NUMBER of slot.
321
322
323 update-deploy NUMBER ... : SRC_FILE DEST_PATH
324      SRC_FILE on the HOST is copied in DEST_PATH of NUMBER of slot.  
325
326
327   
328
329 ```
330
331