Installation

This section describes how to install the OneCloud product.

The 3.x version is different from the previous version which used traditional deployment method to run on CentOS system.x version uses Kubernetes Operator technology to deploy and run on Kubernetes. The platform services will support containerized deployments in Kubernetes clusters, which are inherently highly available and resiliently scalable.

Prepare for installation

Get the installation package

Please obtain the DVD installer for OneCloud from the download center on the product website or by contacting your salesperson.

Configuration requirements

The following table shows the nodes and configuration requirements to be deployed for different scenarios, etc. Please plan the deployment according to the specific usage scenarios.

Deployment scenarios Deployment components Configuration requirements Resource footprint Remarks
Multi-cloud scenario Control Nodes
  • Minimum configuration: 8C16G500G (SSD hard drive recommended & System disk > 200G)
  • Server: supports deployment on servers or physical servers;
  • OS: CentOS 7.6~7.8 Minimal recommended;
  • Configuration requirements: for every additional 500 servers, 8C8G200G of additional system resources are required;
  • Configuration requirements: for every additional 500 servers, 8C8G200G of additional system resources are required;
  • High availability requirements: at least 3 servers of the same configuration are required
  • All resources Access Key ID and Access Key Secret of the cloud account to be managed by Nana with read and write access
    Private Cloud Scenario Control Node
  • Minimum configuration: 8C16G500G (SSD hard drive recommended & System disk > 200G)
  • Server: supports deployment on servers or physical servers;
  • OS: CentOS 7.6~7.8 Minimal recommended;
  • Configuration requirements: for every additional 500 servers, 8C8G200G of additional system resources are required;
  • Configuration requirements: for every additional 500 servers, 8C8G200G of additional system resources are required;
  • High availability requirements: at least 3 servers of the same configuration are required
  • All resources
    Compute Nodes
  • Server: Universal X86 physical server with hardware virtualization features;
  • OS: CentOS 7.6~7.8 Minimal recommended;
  • Configuration requirements: CPU needs to be VT enabled, 32G+ RAM, 1T+ HDD
  • Product services need to occupy 2C2G200G system resources
  • If using classic network then you need to apply for network reachable intranet IP for server
  • .
  • If using a VPC network, you need to apply for an intranet reachable IP address segment as a resilient public IP
  • Ceph Storage Server: Universal X86 physical server;
  • Configuration requirements: at least 32C64G, separate disk for system disk, 4 or more high-capacity SATA hard drives for data disk configuration, and support pass-through mode
  • Networking: 10Gb/s and above
  • No resource consumption
    Baremetal Hosts nano-management
  • Control Node
  • Enabling Baremetal Services
  • Minimum configuration: 8C16G500G (SSD hard drive recommended & System disk > 200G)
  • Server: supports deployment on virtual or physical servers;
  • OS: CentOS 7.6~7.8 Minimal recommended;
  • Configuration requirements: for every additional 500 servers, 8C8G200G of additional system resources are required;
  • Configuration requirements: for every additional 500 servers, 8C8G200G of additional system resources are required;
  • High availability requirements: at least 3 servers of the same configuration are required
  • All resources
    Baremetal
  • Server: Universal X86 physical server;
  • Configuration requirements: IPMI management capability; enable method set to BIOS PXE boot
  • No resource consumption
  • Separate network reachable IPMI and intranet IP subnet for physical machines
  • Requires server to support Redfish if environment does not support DHCP Relay
  • Introduction to installed components

    • A Kubernetes cluster consists of Master (Controlplane) nodes and Node nodes. The number of Controlplane nodes on a set of Kubernetes clusters must be 1, 3, or 5, otherwise there may be problems; the number of Node nodes is arbitrary.
    • The product mainly consists of Controller (control node) and Host (compute node).

    The relationship between the two is shown in the figure below. A server belongs to one of the Controlplane nodes or Node nodes in a Kubernetes cluster, and can act as either a Controller or a Host node on the OneCloud cluster. Servers can have any combination of roles on the Kubernetes cluster and the OneCloud cluster.

    Minimalist networking example

    Based on the component introduction above, the simplest OneCloud environment can be built using two servers.

    • Server description.
      • Where the First Node server serves as the Controlplane node of the Kubernetes cluster, the Controller node and Host node of the OneCloud cluster.
      • Not First Node server as the Node node of the Kubernetes cluster, OneCloud the Host node of the cluster.
    • Version 3.0 supports offline installation, and the installation process can be done without accessing the Internet. However, the later deployment process of importing images from the image market requires access to the Internet.

    Installation process

    Installation method introduction

    There are two ways to install OneCloud using the DVD installer, depending on whether the user’s server has CentOS 7.x OS installed or not, and the first one is recommended. The two ways of executing scripts only are different, and the installation configuration contents are the same.

    • DVD installation: When users use a server without an operating system installed, they can directly mount the downloaded DVD installation package to install CentOS as well as OneCloud .
    • script install: When users are using a server with CentOS 7.x OS installed, they can mount the installation package and use the install script inside to install OneCloud .

    DVD Installation

    The DVD installation method will first install CentOS OS on the server, and the OneCloud installation script will be executed automatically after the installation is completed.

    1. Mount the DVD installation package on the server and start the server.

      • If you need to install on a baremetal hosts, you need to burn the ISO installation package downloaded from the official website in DVD format to a DVD disc or a USB boot image.
        • If you burn it as a DVD disc, please set the boot method in BIOS to CD-ROM corresponding media on the physical server.
        • If you create a USB boot image, please set the boot method in BIOS to the media corresponding to the USB device on the physical server.
      • If you install on a server, you can directly mount the ISO installation package in DVD format onto the virtual CD-ROM drive of the server and set the boot method of the server to CD-ROM drive.
    2. The following parameters are supported to be configured during CentOS system installation, or you can keep the default values and start installing CentOS system directly.

      • LANGUAGE (mandatory): Select the CentOS 7 operating system language, English is the default, click the \ “Continue” button.

      • KEYBOARD (mandatory): Select the keyboard layout. After the setup is finished, if there are no special requirements for disk, network, etc. it is recommended to keep the default and directly click the \ “Begin Installation” button to start the CentOS system installation.

      • INSTALLATION DESTIONATION (optional): Set the disk partition, if there is no special need, it is recommended to keep the default. You can also divide the disk partition according to your needs, etc.

      • NETWORK&HOST NAME (optional): set the network and host name, if there is no special need, you can leave it as default.

    3. During the installation of CentOS system, you need to set the root user password or create a new user. It is recommended to set the root user password.

    4. Wait for the OS installation to complete, then run the installation script automatically and enter the installation configuration page. Please follow the [installation configuration](#installation configuration) content to configure.

    Script Installation

    When installing the product on a server with CentOS installed, you need to make sure that the server has disabled selinux and that the server has been restarted. If selinux is not disabled, please follow the steps below to disable selinux and restart the server.

    # disable selinux
    $ setenforce 0
    $ sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
    

    Execute the script on CentOS 7.x server in the following way.

    1. Connect to the CentOS server remotely as root user and upload the DVD installer to the server.

    2. After uploading, mount the installer as a disk partition on the mnt directory, enter the mnt/yunion directory, and execute the install.sh script file to enter the installation configuration page. Please follow the contents of installation configuration to configure.

      # Please see the installation package name downloaded from the official website
      $ mount -o loop Yunion-x86_64-DVD-3.0.0-20200108.0.iso /mnt  
      $ cd /mnt/yunion
      $ ./install.sh
      

    Installation Configuration

    The configuration content varies slightly depending on whether the server is First Node and the components installed.

    Description of common operations on the configuration page.

    • enter key: enter key is used to confirm the selection button.
    • Space bar: After selecting a sub-menu, you can also press the space bar to enter the sub-menu configuration page; the space bar can also select or deselect specific configuration items.
    • Up and down arrow keys: used to switch up and down menus and configuration items.
    • Tab key or left and right arrow keys: used to switch the bottom side of the “Select”, “OK” and “Help” button, press enter to confirm the selection.

    First Node Server

    1. In the installation configuration page, if the server has multiple NICs, you need to select the NIC as the management network.

    2. Keep the default checkboxes “First Node” and “Enable Host Agent” unchanged, or keep the default checkbox if the database does not require anything else.

    3. If you are using an existing database, you need to move the cursor to “Install MySQL on Current host” by using the up and down arrow keys, press the spacebar to uncheck the item and configure the information of Connect MySql.

      • MySQL Host IP: the IP address of the MySQL server.
      • MySQL Port Number: the port number of the MySQL server.
      • MySQL Username: the user name to connect to MySQL server, root user is recommended, if you use other user, you also need to authorize the user.

    GRANT ALL PRIVILEGES ON * . * TO ‘'@'%’ WITH GRANT OPTION; GRANT ALL PRIVILEGES ON * . * TO ‘'@‘localhost’ WITH GRANT OPTION; ``` - MySQL Password: The password of the user connecting to MySQL server.

    1. In this example, you can choose to install the database on the current host, select the “OK” button on the installation configuration page, press enter, select “Yes” in the pop-up save configuration dialog box, and press enter to confirm the selection and start the installation.

    2. The installation process is long, please be patient until the installation is complete.

    3. Execute the source ~/.bashrc command in the server to load the kubernetes environment variables. After loading, users can manage the OneCloud system components, etc. via kubectl-related commands.

    # View K8s nodes
    $ kubectl get node
    # Check the running status of the component pod, running means running normally
    $ kubectl get pod --namespace onecloud 
    
    1. Type https://服务器IP地址 in your browser to open the OneCloud platform and perform Initialization guide.

    Not First Node server

    This deployment deploys the K8s node and host node on the Not First Node server.

    1. In the installation configuration page, press the spacebar to uncheck “First Node”, and the default for Role of K8S is “K8s Node”; the default for roles is “Enable Host Agent”. Enable Host Agent". You can change the role according to your needs, but in this case, you don’t change it, just keep the default.

    2. Configure First Node IP to be the server IP address of First Node configured in the previous section.

    3. Configure Join Token to be the Token value obtained on the First Node server.

    4. When the configuration is finished, select the “OK” button with the cursor, press enter, select “Yes” with the cursor in the Save Configuration dialog box, and press enter to confirm the selection and start the installation.

    5. The installation process is long, please be patient until the installation is complete.

    6. ssh remote login to the server as root user, and the host node deployment is complete.

    7. After user deployment, you can see the host node in the OneCloud platform host page. The host is disabled by default after it is registered to the cloud management platform, you need to enable the host on the interface, and the enabled host can be used to create servers.

    Enable Baremetal service

    The Baremetal service is disabled by default after the OneCloud platform is installed. Baremetal service provides PXE Server, DHCP, TFTP, http and other functions to complete nano-managed baremetal hosts operations and manage physical machines.

    Users can enable Baremetal service on any node in the OneCloud environment by following the commands below.

    1. Log in to the First Node as root user via SSH, etc.

    2. Execute the following command. Where $node_name is the name of the node; $listen-interface is the name of the NIC on which the baremetal-agent is listening.

      # Enable Baremetal service on the specified node and listen to the NIC
      $ ocadm baremetal enable --node $node_name --listen-interface $listen_interface
      # Disable Baremetal service
      $ ocadm baremetal disable --node $node_name
      # If baremetal service is enabled on node1 host and listening to br0 NIC.
      $ ocadm baremetal enable --node node1 --listen-interface br0
      
    3. After the baremetal service is enabled, you can check whether the baremetal-agent is registered to the control node with the following command.

      $ kubectl get pods --namespace onecloud | grep baremetal
      default-baremetal-agent-fb5d4b5f7-2ld8v 1/1 Running 0 15m
      
    4. The pre-registration and pxe bootstrap registration methods of the baremetal hosts of the NAC need to be used with DHCP Relay, i.e. Baremetal-agent will only process requests from the DHCP Relay server, so it is also necessary for the user to configure DHCP Relay on the switch in advance or use the DHCP Relay function of the Host service.

      # Log in to all servers that have compute nodes deployed and modify /etc/yunion/host.conf to add the dhcp_relay configuration item.
      dhcp_relay:
      - 10.168.222.198 # baremetal agent dhcp service listener address
      - 67 # baremetal agent dhcp service listening port
      
      # Check the pods for the host service
      $ kubectl get pods -n onecloud -o wide | grep host
      default-host-p6d8h 2/2 Running 0 78m 10.168.222.189 k8s-dev1 <none> <none>
      default-host-xdc7x 2/2 Running 0 78m 10.168.222.150 k8s-dev2 <none> <none>
      # Delete the host service pods and restart the host service
      $ kubectl delete pods -n onecloud default-host-p6d8h default-host-xdc7x
      

    Workorder component management

    The OneCloud system enables the process ticket (itsm) component by default, and the administrator can manage the ticket component on the First Node.

    The ticket component management command is as follows.

    # Enable the ticket component
    $ ocadm component enable itsm
    # Disable the ticket component.
    $ ocadm component disable itsm