DCImanager 6 system tools and Ansible configuration management systems are used for location management. Ansible utilizes playbooks — yaml-files that describe the actions to be performed. For more information about Ansible please refer to the official documentation.

To perform operations with locations, DCImanager 6 uses the API-function location.

When performing operations, DCImanager 6 sets an internal status to locations. Depending on a location status, the system can or cannot perform further operations with it. 

Creating a location


To create a location, DCImanager 6 performs the following operations: 

  1. Creates a record about the creation in the database.
  2. Checks that the location can be connected.
  3. Collects information from the location.
  4. Performs preliminary setup of the location.

DCImanager 6 sets the status CREATED for the newly created location.

To check that the location can be connected, DCImanager 6 tries to connect via SSH using the encryption key /opt/ispsystem/dci/etc/.ssh/dci.1. If the connection failed, DCImanager 6 will try to connect using the password. If it connects successfully, DCImanager 6 will add a new public key from the file /opt/ispsystem/dci/etc/.ssh/dci.1.pub. If it cannot connect, it sets the status CHECK_FAILED for the location.

The setup module of the Ansible system is used for collecting statistics from the location. Ansible implements the playbook /opt/ispsystem/dci/etc/playbooks/location_info.yml. If an error occurs during this operation, the location is set the status CHECK_FAILED.

Ansible performs the preliminary setup using the playbook /opt/ispsystem/dci/etc/playbooks/location_presetup.yml:

  1. Connects the additional repository epel.
  2. Installs the software applications libselinux-python, net-snmp, python36, python36-libs, ipmitool, rsync, easysnmp.
  3. Disables SELinux.
  4. Copies the script repeater.py to the location. The script allows for communication with network switches through the SNMP protocol.

If the preliminary setup fails, the location is set the status CHECK_FAILED.

Configuring the location 


To configure the location, DCImanager 6 performs the following operations: 

  1. Checks the parameters specified by the user.
  2. Configures the location.
  3. Installs and configures software on the location.

The system checks the parameters listed below:

  1. The record about the location in the database. If the record is missing, the error with the code 8000 "Location not found" will be returned.
  2. The status:
    • CREATED — the error with the code 8055 "Location is still being created" will be returned;
    • CHECK_FAILED — the error with the code 8056 "Location checking failed" will be returned;
    • SETUP — the error with the code 8059 "Location is already setting up" will be returned.
  3. A list of network interfaces for DHCP:
    • if any of the interfaces from the list is missing on the location, the error with the code 8058 "Location has no such interface" will be returned;
    • if the list is empty, the error with the code 8057 "DHCP interfaces not set" will be returned. 
  4. The IP address set for Nginx on the network interface. If the address is not assigned, the error with the code 8060 "Location has no such address" will be returned. 

DCImanager 6 saves the parameters in the database and sets the status SETUP for the location.

To install and configure software applications on the location, Ansible performs the operations from the playbook /opt/ispsystem/dci/etc/playbooks/location_setup.yml:

  1. Connects the additional repository epel.
  2. Configures the NFS.
  3. Installs docker.
  4. Removes the kea and kea-libs packages, if installed.
  5. Uploads, sets up, and runs software docker-containers of the location.
  6. Adds network connections used by docker-containers into the list of firewalld exclusions.
  7. Enables autostart for the docker and firewall services.

Editing the location


To edit the location, DCImanager 6 performs the following operations: 

  1. Checks the parameters specified by the user. If they differ from the parameters in the database or the location has the status CHECK_FAILED, it repeats the operations it has performed to create a new location. 
  2. Creates a range of IP addresses for the location, if it was not allocated before.

Deleting the location


To delete the location, DCImanager 6 performs the following operations: 

  1. Checks its status. If it is CREATED or SETUP the error with the code 8066 "Location status is not OK" will be returned.
  2. Searches for servers, switches, and PDU assigned to the location. If the devices are found, the error with the code 8054 "Location cannot be removed" will be returned. 
  3. Deletes the range of IP addresses on the location, if it was created before.

Logs


The log files are located in the container dci_back on the server with DCImanager 6:

  • /var/log/dci_1_writer.log — the start of the location configuration and creation tasks;
  • /var/log/dci_locationctl.log — operations that check the connection to the location via SSH;
  • /var/log/dci_ansiblectl_location_<location id>.log — Ansible operations;
  • /var/log/ansible.log — Ansible playbooks.

To go to the container, connect to the server with DCImanager 6 via SSH and execute the command:

docker exec -it dci_back sh
CODE