OSDN Git Service

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