OSDN Git Service

Dockerfile for ubuntu16.04
[fulcon/Fulcon.git] / README.md
index 3fb971e..006a660 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,33 +1,43 @@
-## Fulcon VirtualPlatform
+Fulcon / Slot-OS Platform 0.4    Copyright (C) 2015-2016 NIWA Hideyuki
+    Apache License Version 2.0
 
-`Fulcon` is the system container tool.
+## What is Fulcon/Slot-OS?
 
-## State of the project
+- Slot-OS divides the HOST machine into two or more software partitions (slot). 
+- Each slot can be operated like another machine of the same composition. 
+- Root of the Fulcon/Slot-OS container has a strong root authority, and the same operation as root of HOST is possible. 
+- The slot can dynamically compose the network. (SDN function)
 
-In Fulcon, the container can be handled like VM.
-Fulcon constructs the system by generating the container, logging in 
-from the console, and installing the package with yum and apt, and stops 
-the system with shutdown command.The container can be connected directly with
-the Internet by adding virtual NIC.
-Fulcon can handle CentOS 7 and Ubuntu 15.04
+## Function of Fulcon/Slot-OS
+- Function to divide machine into two or more slots
+- Function to generate image for slot from rootfs of HOST
+- Dynamic addition and deletion (SDN) function of two or more Internet Protocol addresses
+- Allocation of resource of each slot (CPU%, number of CPU, and memory size) and dynamic modification function
+- Console function of slot
+- Listing function of the entire slot
+- Suspension (temporary stop) and resume of slot
+- Automatic update-function of two or more slots
+- High-speed backup function
 
-### Install pacage
+Fulcon can handle CentOS 7, Ubuntu 15.04, 15.10, Fedora 23
+
+### Install package
 
 ubuntu
 
-$  sudo apt-get install docker.io python-ipy bridge-utils  
+$  sudo apt-get install docker.io python-ipy bridge-utils openvswitch-switch
 $  sudo systemctl enable docker.service
 $  sudo systemctl start docker.service
-$  sudo dpkg -i fulcon_0.3_amd64.deb
+$  sudo dpkg -i fulcon_0.4_amd64.deb
 $  sudo systemctl enable fulcon.service
 $  sudo systemctl start fulcon.service
 
-CentOS
+CentOS, Fedora
 
-$  sudo yum install docker-io python-IPy bridge-utils  
+$  sudo yum install docker-io python-IPy bridge-utils openvswitch
 $  sudo systemctl enable docker.service
 $  sudo systemctl start docker.service
-$  sudo rpm -ivh fulcon-0.3-1.el7.centos.x86_64.rpm
+$  sudo rpm -ivh fulcon-0.4-1.el7.centos.x86_64.rpm
 $  sudo systemctl enable fulcon.service
 $  sudo systemctl start fulcon.service
  
@@ -35,7 +45,7 @@ $  sudo systemctl start fulcon.service
 
 ubuntu
 
-$  sudo apt-get install docker.io python-ipy bridge-utils  
+$  sudo apt-get install docker.io python-ipy bridge-utils openvswitch-switch
 $  sudo systemctl enable docker.service
 $  sudo systemctl start docker.service
 $  tar xzf fulcon.tgz  
@@ -44,9 +54,9 @@ $  sudo make install
 $  sudo systemctl enable fulcon.service
 $  sudo systemctl start fulcon.service
   
-CentOS 7  
+CentOS, Fedora
   
-$  sudo yum install docker-io python-IPy bridge-utils  
+$  sudo yum install docker-io python-IPy bridge-utils openvswitch
 $  sudo systemctl enable docker.service
 $  sudo systemctl start docker.service
 $  tar xzf fulcon.tgz  
@@ -56,219 +66,226 @@ $  sudo systemctl enable fulcon.service
 $  sudo systemctl start fulcon.service
   
 ### Setup:  
+
+#### 1. Generation of OS image (make-base-image subcommand)
+
+If the slot-os image has not been generated yet, the slot-os image is necessary as OS of slot. 
+Rootfs for slot is generated from rootfs of HOST. 
+It takes 50 minutes from ten minutes for generation. (Depend on the machine performance and the size of rootfs. )
   
-1) The image of CentOS 7, Ubuntu15.04 and Ubuntu15.10 is prepared.  
-  
-$  sudo fulcon setup -d centos7  
-$  sudo fulcon setup -d ubuntu1504  
-$  sudo fulcon setup -d ubuntu1510  
-  
-It takes the minute to several ten completion.
-It only has to execute only the kind of the image to be used.
-This operation do only first once.
-
-The image is builded by using Dockerfile.
-If it does not go well.images are generated with following Dockerfile.  
-     /var/lib/fulcon/driver/dockerfile/centos7/Dockerfile  
-     /var/lib/fulcon/driver/dockerfile/ubuntu1504/Dockerfile  
-     /var/lib/fulcon/driver/dockerfile/ubuntu1510/Dockerfile  
-It must be builded "fulcon/centos7", "fulcon/ubuntu1504" and "fulcon/ubuntu1510"
-
-2) The image of default is set.  
-  
-$  sudo fulcon set-default-image fulcon/centos7  
-or  
-$  sudo fulcon set-default-image fulcon/ubuntu1504  
-or  
-$  sudo fulcon set-default-image fulcon/ubuntu1510  
-  
-fulcon/centos7 is set in the following examples.  
+$  sudo fulcon make-base-image
+
+#### 2. Making of Slot partition (build subcommand)
+- HOST is divided into two or more slot. 
+- The resource of Slot is automatically initialized. 
+  CPU% = (all CPU the number)*100% / (slot number) 
+  allocation CPU = all CPU the number
+  CPU MEMORY =  512MB
+- When 0 is specified for a number of Slot, all slot is deleted. 
+
+The following examples divide HOST into three. 
+
+$ sudo Slot-OS build 3
   
 ### Using:  
   
-#### 1.Generation of container  
+#### 3.The display the list of slot (list subcommand) 
+The "list of slot" is displayed. 
+Slot number, state, slot name, CPU%, CPU allocation, and memory size, 
+autostart, image names, and Internet Protocol addresses
+
+$ sudo slot-os list
+ 0 : RUNNING  slot00 66 % 0-1 512m A Slot-OS 172.17.0.2
+ 1 : STOPPED  slot01 66 % 0-1 512m - Slot-OS
+ 2 : STOPPED  slot02 66 % 0-1 512m - Slot-OS
+
+#### 4. Boot of slot (start subcommand)
+All slot or of specify slot is booted by the number. 
+
+The 0th slot is booted. 
+$ sudo slot-os start 0
+$ sudo slot-os list
+ 0 : RUNNING  slot00 66 % 0-1 512m A Slot-OS
+ 1 : STOPPED  slot01 66 % 0-1 512m - Slot-OS
+ 2 : STOPPED  slot02 66 % 0-1 512m - Slot-OS
+
+All slot is booted. 
+$ sudo slot-os start all
+$ sudo slot-os list
+ 0 : RUNNING  slot00 66 % 0-1 512m A Slot-OS
+ 1 : RUNNING  slot01 66 % 0-1 512m - Slot-OS
+ 2 : RUNNING  slot02 66 % 0-1 512m - Slot-OS
+
+#### 5. Console of Slot
+The console of Slot number 0 is opened. 
+
+$ sudo slot-os console 0
+
+#### 6. Update and package application (update, update-prog, and update-deploy subcommand)
+
+It is an automatic update as for the package of all slot. 
+
+$ sudo slot-os update all
+
+The package is copied under/root of all slot. 
+
+$ sudo slot-os deploy all : perl-XML-Parser-2.41-8.el7.x86_64.rpm /root
+
+The package copied with all slot is installed. 
+
+$ sudo slot-os update-prog all : rpm -ivh /root/perl-XML-Parser-2.41-8.el7.x86_64.rpm
+
+The package copied with all slot is deleted. 
+
+$ sudo slot-os update-prog all : rm -f /root/perl-XML-Parser-2.41-8.el7.x86_64.rpm
+
+#### 7. Stop and renewal of slot (start, stop, suspend, and resume subcommand)
+
+Shutdown
+
+$ sudo slot-os stop 0
+
+Boot
+
+$ sudo slot-os start 0
+
+Temporary stop (suspension)
+
+$ sudo slot-os suspend 0
+
+Restart
+
+$ sudo slot-os resume 0
+
+#### 8. Backup and restoration of slot (backup and restore subcommand)
+
+Backup of slot
+
+$ sudo slot-os backup 0 bkup1
+
+"bkup1" describes it on of putting on the backup name. Anything is good 
+in the alphanumeric character. 
+The backup image name is as follows. 
+slot00.bkup1
+
+Restoration of backup
+
+$ sudo slot-os backup-restore 0 slot00.bkkup1
+
+List of backup
+
+$ sudo slot-os backup-list
+
+The initialization of slot restores slot-os. 
+
+$ sudo slot-os backup-restore 0 slot-os
+
+#### 9. Dynamic addition and deletion of network (net-add and net-del subcommand)
+
+When Slot is booted, the network of 172.17.0.0/16 is added. 
+This Internet Protocol address changes at each boot. 
+NAT setting of network of 172.17.0.0/16
+
+Internet Protocol address is added. The address of 192.168.18.2/24 is added to 0 of 
+Slot as the first NIC. 
+
+$ sudo slot-os net-add 0 192.168.18.2/24 1
+
+Addition of second NIC
+
+$ sudo slot-os net-add 0 192.168.78.3/24 2
+
+The state of NIC is displayed. 
+
+$ sudo slot-os net-info
+slot00 eth0            172.17.0.2/16
+slot00 vgslot00_1      192.168.18.2/24
+slot00 vgslot00_2      192.168.78.2/24
+
+Internet Protocol address is deleted. 
+IP of the second of Slot 0 are deleted. 
+
+$ sudo slot-os net-del 0 2
+
+#### 10. NIC of HOST is shared (net-nic-add and net-nic-del subcommand). 
+
+Outside HOST and slot communicates sharing NIC of HOST. 
+The NIC name of HOST : with ens7f1 for address 10.124.23.91/24. 
+
+$ sudo slot-os net-nic-add ens7f1
+
+It adds it to the third Slot 0 by 10.124.23.101/24. 
+
+$ sudo slot-os net-add 0 10.124.23.101/24 3
+
+It comes to be able to access slot 0 outside HOST by 10.124.23.101. 
+
+NIC(ens7f1) of HOST is removed. 
+
+$ sudo slot-os net-nic-del ens7f1
 
-In the following example, the container "webap-server" is generated.
-  
-$  sudo fulcon sysgen webap-server  
-  
-The container of "fulcon/centos7" was generated.
-It is optional -c, and "fulcon/ubuntu1504" can be specified.
-  
-$  sudo fulcon sysgen -c fulcon/ubuntu1504 another-server  
-  
-#### 2.The user is added, and the password is set.  
-  
-In the following example, the user "niwa" is seted.
-The last argument is set to passwd.
-  
-$  sudo fulcon add-user webap-server niwa 
-Please use optional "-s" to give the sudo right to the user.
-  
-$  sudo fulcon add-user -s webap-server tom
 
-Please use the "set-passwd" sub-command if you want to change the password.
-$  sudo fulcon set-passwd webap-server niwa
-The "del-user" subcommand is used to delete the user from the container. 
-$  sudo fulcon del-user webap-server tom
-#### 3.Virtual NIC addition  
-  
-$  sudo fulcon net-add webap-server 192.168.17.2/24 1
-  
-Information of network is able to be taken  by "fulcon net-info".  
-$  sudo fulcon net-info  
-  
-When the network is connected with host's device in the container it, 
-optional "-d" is used. 
-IP-address specifies it within the range of same netmask as the shared device. 
-In the following example, when it is NIC "eth1" and the address is 
-"192.168.0.2/24", "192.168.0.12/24" is allocated in the container.
-$ sudo fulcon net-add -d eth1 webap-server 192.168.0.12/24 1
-  
-#### 4.Attache console to the container.
-  
-$  sudo fulcon console webap-server  
-You return from the console to the host if you do "Exit".
-  
-#### 5.When you login the container, yum and apt can be used.  
-   You can login with ssh.  
-   "shutdown -h now" can be used in container.  
-  
-#### 6.Stop and start of container  
-  
-$  sudo fulcon stop webap-server  
-  
-$  sudo fulcon start webap-server  
-  
-#### 7.List containers  
-  
-$  sudo fulcon list 
-  
-#### 8.Erase container  
-  
-$  sudo fulcon erase webap-server  
 ### ALL Sub command:  
 ```
   
-  
-add-user [ -n REAT_NUMBER ] [ -s ] CONTAINER_NAME USER [PASSWORD ]  
-     A new user is registered in OS of the container.  
-     The password is set with PASSWORD.  
-     The password is interactively set when there is no PASSWORD.  
-     -n REAT_NUMBER  
-          It is specified to the container name that CONTAINER_NAME and 
-          the number combined.
-          ex) "AB" and 3 : AB0001, AB0002, AB0003  
-     -s 
-          The user gets administrator's rights.  
-  
+auotstart NAME [ on | off ] ( all | SLOT_NUMBER...)
+     NAME is started automatically at the time of a system restart.
+
+backup NUMBER NEW_NAME
+     slot in NUMBER is backuped. A backup will be slotXX.NEW_NAME.
+
+backup-del IMAGE_NAME
+     A backup of IMAGE_NAME is erased.
+
+backup-list
+     A list of backups is indicated.
+
+backup-restore SLOT_NUMBER BACKUP_IMAGE
+     backup image is restored in slot.
+
 br-add BRIDGE_NUMBER ( IPADDR/MASK | NET_DEVICE ]
      The IP-address or the device is registered in the bridge.
   
-br-del BRIDGE_NUMBER ( IPADDR/MASK | NET_DEVICE ]
+br-del BRIDGE_NUMBER
      The IP-address or the device is deleted in the bridge.
   
 br-info
      Information on the bridge where NIC that adds it is connected is displayed.  
   
-clone CONTAINER_NAME NEW_IMAGENAME
-     A new image is made from the container.  
-     New containers of the same content can be made from a new image.  
-  
-console [ -n REPEAT_NUMBER ] CONTAINER_NAME  
-     It enters the container with the console.   
-     -n REAT_NUMBER  
-          It is specified to the container name that CONTAINER_NAME and 
-          the number combined.
-          ex) "AB" and 3 : AB0001, AB0002, AB0003  
-  
-default-image  
-     The default image that generates the container is displayed.  
-  
-del-image IMAGE_NAME ...  
-     The specified image is deleted.   
-  
-del-ocf IMAGE_NAME  
-     The specified OCF image is deleted.   
-     (The OCF image becomes basic that generates the container.)  
-  
-del-user CONTAINER_NAME USERNAME  
-     The user specified in the container is deleted.  
-  
-deploy [ -c IMAGE ] SRC_FILE DEST_PATH 
-     SRC_FILE on the host is copied in DEST_PATH of all containers.  
-     -c IMAGE
-          Only a container of IMAGE is made the target.  
-          IMAGE is the part of the image name.  
-  
-dirver-name  
-     The container system that uses it as a driver of fulcon is displayed.  
-  
-erase CONTAINER_NAME  ...  
-erase -n REPEAT_NUMBER CONTAINER_NAME  
-     The specified container is deleted.   
-     -n REAT_NUMBER  
-          It is specified to the container name that CONTAINER_NAME and 
-          the number combined.
-          ex) "AB" and 3 : AB0001, AB0002, AB0003  
-  
-help  
-     Use is displayed.  
-  
-image-catalog  
-     The list of the registered image is displayed.  
-  
-list  
-     The list of the made container is displayed.  
-  
-load-ocf IMAGE_NAME  
-     The OCF image is loaded as an image used for the container.  
-  
-ls-image  
-     The list of the image is displayed.  
-  
-ls-ocf  
-     The list of the OCF image is displayed.  
-  
-net-add [-d NIC_DEVICE] [-g GATEWAY] [-b BRIDGE_NUMBER ] CONTAINER_NAME IP_ADDR/MASK VETH_NUMBER
-     NIC is added to the container.   
-     -d NIC_DEVICE  
-          The device to connect it to an external network is specified.   
-     -g GATEWAY
-          GATEWAY that is used in the container
-     -b BRIDGE_NUMBER
-          BRIDGE that combines "'fulcon' and specified number" is added.  
-          ex) BRIDGE_NUMBER is 2 -> nic "fulcon2"  
-     VETH_NUMBER  
-          NIC that combines "Container name and specified number" is added.  
-          ex) VETH_NUMBER is 1 and container is "abc" -> nic "abc1"  
-  
-net-del CONTAINER_NAME VETH_NUMBER
-     NIC is deleted from the container.   
-     VETH_NUMBER  
-          NIC that combines "Container name and specified number" is added.  
-          ex) VETH_NUMBER is 1 and container is "abc" -> nic "abc1"  
-  
-net-info NAME  
+build NUMBER
+     HOST is separated in NUMBER and slot is made.
+     When 0 is specified, all slot is erased.
+
+list [ -c ] [ NAME ]
+     The list of the made slot is displayed.  
+     Display term is as follows.
+       NUM, Status, Container name, CPU%, CPUS, Memory, Autostart(A or -), Image name, IP address
+     -c 
+          It always keeps indicating list. When stopping, ^c is pushed.
+
+help
+     Help is displayed.  
+
+
+list [ SLOT_NUMBER ]
+     The list of the made slot is displayed.  
+
+make-base-image
+     fulcon/slot-os image is generated from HOST.
+     It even takes tens of minutes for completion.
+
+net-add SLOT_NUMBER IPADDR/MASK NIC_NUMBER 
+     NIC is added to the slot.   
+
+net-del SLOT_NUMBER NIC_NUMBER
+     NIC is deleted from the slot.   
+
+net-info [ NAME ]
      Information on the network where NIC that adds it is connected is displayed.  
-  
-rename   CONTAINER_NAME NEW_NAME  
-     The container name is renamed.  
-  
-resource [-c CPU] [-n CPUSET] [-m MEM] NAME   
-     The resource allocated in the container is displayed if there is no "-c, -n, -m" option.  
+
+
+resource [-c CPU] [-n CPUSET] [-m MEM] ( all | NUMBER ... )
+     The resource allocated in the slot is displayed if there is no "-c, -n, -m" option.  
      -c CPU  
           The ratio of allocated CPU is % specified.   
      -n CPUSET  
@@ -277,68 +294,36 @@ resource [-c CPU] [-n CPUSET] [-m MEM] NAME
           The allocated memory size are specified.  
           "M" and "G" can be used for the unit.  
   
-resume   NAME  
-     Resume does the container in the state of PAUSED by suspend.  
-  
-save-ocf IMAGE_NAME  
-     The OCF image is saved as an image used for the container.  
-  
-set-default-image [ IMAGE_NAME ]  
-     Default image is set.  
-     The default image that generates the container is displayed.  
-  
-set-passwd NAME USERNAME  
-     User's password in the container is set.  
-  
-setup [[ -d ][ -n ] [ -p ] IMAGE_NAME ]
-     The image is newly made.
-     -d
-          New image is downloaded from docker repositry.
-     -n
-          Generates a new image from a Dockerfile.
-     -p  
-          Proxy is set.  
-          The value of the environment variable "Http_proxy, https_proxy, and ftp_proxy" is used.  
-     The image is generated from HOST if there is no argument.
-  
-update-prog [ -c IMAGE ] COMMAND 
-     The same command is carried out by more than one container.  
-     -c IMAGE
-          Only a container of IMAGE is made the target.  
-          IMAGE is the part of the image name.  
-  
-start CONTAINER_NAME ...  
-start -n REPEAT_NUMBER CONTAINER_NAME  
-     The container of the specified name is started.  
-     -n REAT_NUMBER  
-          "User and password" is set to the container of  
-          the name that NAME and the figure combined.  
-          ex) "AB" and 3 : AB0001, AB0002, AB0003  
-  
-stop NAME  ...  
-stop -n REPEAT_NUMBER NAME  
-     The container of the specified name is stopped.   
-     -n REAT_NUMBER  
-          "User and password" is set to the container of  
-          the name that NAME and the figure combined.  
-          ex) "AB" and 3 : AB0001, AB0002, AB0003  
-  
-suspend   CONTAINER_NAME  
-     The container of the specified name is suspended.  
-  
-sysgen [ -c IMAGE ] NAME NAME ...  
-sysgen -n REPEAT_NUMBER  [ -c IMAGE ] NAME  
-     The container of the specified name is generated.  
-     -n REAT_NUMBER  
-          "User and password" is set to the container of  
-          the name that NAME and the figure combined.  
-          ex) "AB" and 3 : AB0001, AB0002, AB0003  
-  
-update  
-     All containers are renewed.   
+
+resume ( all | NUMBER ... )
+     Resume does the slot in the state of SUSPENDED by suspend.  
+
+start ( all | NUMBER ... )
+     The slot of the specified NUMBER is started.  
+
+
+stop ( all | NUMBER ... )
+     The slot of the specified NUMMBER is stopped.   
+
+
+suspend ( all | NUMBER ... )
+     The NUMBER of the specified NUMBER is suspended.  
+
+
+update ( all | NUMBER ...)
+     All slot os packages are updated.   
      "Yum update" is done in centos. In ubuntu,   
      "Apt-get update" and "Apt-get upgrade" are done.   
-  
+
+
+update-prog ( all | NUMBER ... ) : COMMAND
+     A COMMAND program for update is executed in NUMBER of slot.
+
+
+update-deploy NUMBER ... : SRC_FILE DEST_PATH
+     SRC_FILE on the HOST is copied in DEST_PATH of NUMBER of slot.  
+
+
   
 
 ```