OSDN Git Service

start release 0.3
[fulcon/Fulcon.git] / README.md
1 ## Fulcon VirtualPlatform
2
3 `Fulcon` is the system container tool.
4
5 ## State of the project
6
7 In Fulcon, the container can be handled like VM.
8 Fulcon constructs the system by generating the container, logging in 
9 from the console, and installing the package with yum and apt, and stops 
10 the system with shutdown command.The container can be connected directly with
11 the Internet by adding virtual NIC.
12 Fulcon can handle CentOS 7 and Ubuntu 15.04
13
14 ### Install pacage
15
16 ubuntu
17
18 $  sudo apt-get install docker.io  
19 $  sudo apt-get install python-ipy  
20 $  sudo apt-get install bridge-utils  
21 $  sudo dpkg -i fulcon_0.3_amd64.deb
22
23 CentOS
24
25 $  sudo yum install docker-io  
26 $  sudo yum install python-IPy  
27 $  sudo yum install bridge-utils  
28 $  sudo rpm -ivh fulcon-0.3-1.el7.centos.x86_64.rpm
29  
30 ### Building:
31
32 ubuntu
33
34 $  sudo apt-get install docker.io  
35 $  sudo apt-get install python-ipy  
36 $  sudo apt-get install bridge-utils  
37   
38 $  tar xzf fulcon.tgz  
39 $  cd fulcon  
40 $  sudo make install  
41   
42 CentOS 7  
43   
44 $  sudo yum install docker-io  
45 $  sudo yum install python-IPy  
46 $  sudo yum install bridge-utils  
47   
48 $  tar xzf fulcon.tgz  
49 $  cd fulcon  
50 $ sudo make install  
51   
52 ### Setup:  
53   
54 1) The image of CentOS 7, Ubuntu15.04 and Ubuntu15.10 is prepared.  
55   
56 $  sudo fulcon setup centos7  
57 $  sudo fulcon setup ubuntu1504  
58 $  sudo fulcon setup ubuntu1510  
59   
60 It takes the minute to several ten completion.
61 It only has to execute only the kind of the image to be used.
62 This operation do only first once.
63
64 The image is builded by using Dockerfile.
65 If it does not go well.images are generated with following Dockerfile.  
66      /var/lib/fulcon/driver/dockerfile/centos7/Dockerfile  
67      /var/lib/fulcon/driver/dockerfile/ubuntu1504/Dockerfile  
68      /var/lib/fulcon/driver/dockerfile/ubuntu1510/Dockerfile  
69 It must be builded "fulcon/centos7", "fulcon/ubuntu1504" and "fulcon/ubuntu1510"
70
71 2) The image of default is set.  
72   
73 $  sudo fulcon set-default-image fulcon/centos7  
74 or  
75 $  sudo fulcon set-default-image fulcon/ubuntu1504  
76 or  
77 $  sudo fulcon set-default-image fulcon/ubuntu1510  
78   
79 fulcon/centos7 is set in the following examples.  
80   
81 ### Using:  
82   
83 #### 1.Generation of container  
84
85 In the following example, the container "webap-server" is generated.
86   
87 $  sudo fulcon sysgen webap-server  
88   
89 The container of "fulcon/centos7" was generated.
90 It is optional -c, and "fulcon/ubuntu1504" can be specified.
91   
92 $  sudo fulcon sysgen -c fulcon/ubuntu1504 another-server  
93   
94 #### 2.The user is added, and the password is set.  
95   
96 In the following example, the user "niwa" is seted.
97 The last argument is set to passwd.
98   
99 $  sudo fulcon add-user webap-server niwa 
100  
101 Please use optional "-s" to give the sudo right to the user.
102   
103 $  sudo fulcon add-user -s webap-server tom
104
105 Please use the "set-passwd" sub-command if you want to change the password.
106  
107 $  sudo fulcon set-passwd webap-server niwa
108  
109 The "del-user" subcommand is used to delete the user from the container. 
110  
111 $  sudo fulcon del-user webap-server tom
112  
113 #### 3.Virtual NIC addition  
114   
115 $  sudo fulcon net-add webap-server 192.168.17.2/24  
116   
117 Information of network is able to be taken  by "fulcon net-info".  
118  
119 $  sudo fulcon net-info  
120   
121 When the network is connected with host's device in the container it, 
122 optional "-d" is used. 
123 IP-address specifies it within the range of same netmask as the shared device. 
124  
125 In the following example, when it is NIC "eth1" and the address is 
126 "192.168.0.2/24", "192.168.0.12/24" is allocated in the container.
127  
128 $ sudo fulcon net-add -d eth1 webap-server 192.168.0.12/24
129   
130 #### 4.Attache console to the container.
131   
132 $  sudo fulcon console webap-server  
133  
134 You return from the console to the host if you do "Exit".
135   
136 #### 5.When you login the container, yum and apt can be used.  
137    You can login with ssh.  
138    "shutdown -h now" can be used in container.  
139   
140 #### 6.Stop and start of container  
141   
142 $  sudo fulcon stop webap-server  
143   
144 $  sudo fulcon start webap-server  
145   
146 #### 7.List containers  
147   
148 $  sudo fulcon list 
149   
150 #### 8.Erase container  
151   
152 $  sudo fulcon erase webap-server  
153  
154  
155  
156 ### ALL Sub command:  
157 ```
158   
159   
160 add-user [ -n REAT_NUMBER ] [ -s ] CONTAINER_NAME USER [PASSWORD ]  
161      A new user is registered in OS of the container.  
162      The password is set with PASSWORD.  
163      The password is interactively set when there is no PASSWORD.  
164      -n REAT_NUMBER  
165           It is specified to the container name that CONTAINER_NAME and 
166           the number combined.
167           ex) "AB" and 3 : AB0001, AB0002, AB0003  
168      -s 
169           The user gets administrator's rights.  
170   
171 br-add BRIDGE_NUMBER ( IPADDR/MASK | NET_DEVICE ]
172      The IP-address or the device is registered in the bridge.
173   
174 br-del BRIDGE_NUMBER ( IPADDR/MASK | NET_DEVICE ]
175      The IP-address or the device is deleted in the bridge.
176   
177 br-info
178      Information on the bridge where NIC that adds it is connected is displayed.  
179   
180 clone CONTAINER_NAME NEW_IMAGENAME
181      A new image is made from the container.  
182      New containers of the same content can be made from a new image.  
183   
184 console [ -n REPEAT_NUMBER ] CONTAINER_NAME  
185      It enters the container with the console.   
186      -n REAT_NUMBER  
187           It is specified to the container name that CONTAINER_NAME and 
188           the number combined.
189           ex) "AB" and 3 : AB0001, AB0002, AB0003  
190   
191 default-image  
192      The default image that generates the container is displayed.  
193   
194 del-image IMAGE_NAME ...  
195      The specified image is deleted.   
196   
197 del-ocf IMAGE_NAME  
198      The specified OCF image is deleted.   
199      (The OCF image becomes basic that generates the container.)  
200   
201 del-user CONTAINER_NAME USERNAME  
202      The user specified in the container is deleted.  
203   
204 deploy [ -c IMAGE ] SRC_FILE DEST_PATH 
205      SRC_FILE on the host is copied in DEST_PATH of all containers.  
206      -c IMAGE
207           Only a container of IMAGE is made the target.  
208           IMAGE is the part of the image name.  
209   
210 dirver-name  
211      The container system that uses it as a driver of fulcon is displayed.  
212   
213 erase CONTAINER_NAME  ...  
214 erase -n REPEAT_NUMBER CONTAINER_NAME  
215      The specified container is deleted.   
216      -n REAT_NUMBER  
217           It is specified to the container name that CONTAINER_NAME and 
218           the number combined.
219           ex) "AB" and 3 : AB0001, AB0002, AB0003  
220   
221 help  
222      Use is displayed.  
223   
224 image-catalog  
225      The list of the registered image is displayed.  
226   
227 list  
228      The list of the made container is displayed.  
229   
230 load-ocf IMAGE_NAME  
231      The OCF image is loaded as an image used for the container.  
232   
233 ls-image  
234      The list of the image is displayed.  
235   
236 ls-ocf  
237      The list of the OCF image is displayed.  
238   
239 net-add -n VETH_NUMBER [-d NIC_DEVICE] [-g GATEWAY] [-b BRIDGE_NUMBER ] CONTAINER_NAME IP_ADDR/MASK  
240      NIC is added to the container.   
241      -n VETH_NUMBER  
242           NIC that combines "Container name and specified number" is added.  
243           ex) VETH_NUMBER is 1 and container is "abc" -> nic "abc1"  
244      -d NIC_DEVICE  
245           The device to connect it to an external network is specified.   
246      -g GATEWAY
247           GATEWAY that is used in the container
248      -b BRIDGE_NUMBER
249           BRIDGE that combines "'fulcon' and specified number" is added.  
250           ex) BRIDGE_NUMBER is 2 -> nic "fulcon2"  
251   
252 net-del -n VETH_NUMBER CONTAINER_NAME  
253      NIC is deleted from the container.   
254      -n VETH_NUMBER  
255           NIC that combines "Container name and specified number" is added.  
256           ex) VETH_NUMBER is 1 and container is "abc" -> nic "abc1"  
257   
258 net-info NAME  
259      Information on the network where NIC that adds it is connected is displayed.  
260   
261 rename   CONTAINER_NAME NEW_NAME  
262      The container name is renamed.  
263   
264 resource [-c CPU] [-n CPUSET] [-m MEM] NAME   
265      The resource allocated in the container is displayed if there is no "-c, -n, -m" option.  
266      -c CPU  
267           The ratio of allocated CPU is % specified.   
268      -n CPUSET  
269           The allocated CPU number is specified.  
270      -m MEM  
271           The allocated memory size are specified.  
272           "M" and "G" can be used for the unit.  
273   
274 resume   NAME  
275      Resume does the container in the state of PAUSED by suspend.  
276   
277 save-ocf IMAGE_NAME  
278      The OCF image is saved as an image used for the container.  
279   
280 set-default-image [ IMAGE_NAME ]  
281      Default image is set.  
282      The default image that generates the container is displayed.  
283   
284 set-passwd NAME USERNAME  
285      User's password in the container is set.  
286   
287 setup [ -n ] [ -p ] IMAGE_NAME  
288      The image is newly made.  
289      -n
290           Generates a new image from a Dockerfile.
291      -p  
292           Proxy is set.  
293           The value of the environment variable "Http_proxy, https_proxy, and ftp_proxy" is used.  
294   
295 setup-prog [ -c IMAGE ] COMMAND 
296      The same command is carried out by more than one container.  
297      -c IMAGE
298           Only a container of IMAGE is made the target.  
299           IMAGE is the part of the image name.  
300   
301 start CONTAINER_NAME ...  
302 start -n REPEAT_NUMBER CONTAINER_NAME  
303      The container of the specified name is started.  
304      -n REAT_NUMBER  
305           "User and password" is set to the container of  
306           the name that NAME and the figure combined.  
307           ex) "AB" and 3 : AB0001, AB0002, AB0003  
308   
309 stop NAME  ...  
310 stop -n REPEAT_NUMBER NAME  
311      The container of the specified name is stopped.   
312      -n REAT_NUMBER  
313           "User and password" is set to the container of  
314           the name that NAME and the figure combined.  
315           ex) "AB" and 3 : AB0001, AB0002, AB0003  
316   
317 suspend   CONTAINER_NAME  
318      The container of the specified name is suspended.  
319   
320 sysgen [ -c IMAGE ] NAME NAME ...  
321 sysgen -n REPEAT_NUMBER  [ -c IMAGE ] NAME  
322      The container of the specified name is generated.  
323      -n REAT_NUMBER  
324           "User and password" is set to the container of  
325           the name that NAME and the figure combined.  
326           ex) "AB" and 3 : AB0001, AB0002, AB0003  
327   
328 update  
329      All containers are renewed.   
330      "Yum update" is done in centos. In ubuntu,   
331      "Apt-get update" and "Apt-get upgrade" are done.   
332   
333   
334
335 ```
336
337