OSDN Git Service

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