Console utilities

RSserver API service

It provides API for managing TRS projects and instances.

  • Command:

    aos-rs-server-api
    
  • systemd service name:

    aos-rs-server-api.service
    
Utility arguments
Name Description Default value
--host IP address on which service will run. 0.0.0.0
--port Port on which service will run. 9364
--certfile SSL certificate file path for secure connection.  
--keyfile SSL certificate private key path for secure connection.  
--debug Argument which allows to start service in the DEBUG mode. False
--logfile Logging file path. /var/log/aos/rs-server/api.log

TRS broker API service

It provides API for connecting to TRS instances from RSclient.

  • systemd service name:

    aos-rs-broker-api.service
    

Running periodic tasks

Utility periodically starts tasks performed by aos-rs-worker service:

sync_projects
synchronization of the project type in the project table of keystone database with the projects table of the rs_server database to keep the list of projects up to date.
  • Command:

    aos-rs-beat
    
  • systemd service name:

    aos-rs-beat.service
    
Utility arguments
Name Description Default value
--debug Argument which allows to start service in the DEBUG mode. False
--logfile Logging file path. /var/log/aos/rs-server/beat.log

Asynchronous operations with TRS instances

Utility performs asynchronous tasks of creating and retrieving TRS instances.

  • Command:

    aos-rs-worker
    
  • systemd service name:

    aos-rs-worker.service
    
Utility arguments
Name Description Default value
--debug Argument which allows to start service in the DEBUG mode. False
--logfile Logging file path. /var/log/aos/rs-server/worker.log

Event monitoring

Utility allows to monitor the events of Keystone, Nova, Neutron and keep the information in the database tables rs_server up to date.

  • Command:

    aos-rs-listener
    
  • systemd service name:

    aos-rs-listener.service
    
Utility arguments
Name Description Default value
--debug Argument which allows to start service in the DEBUG mode. False
--logfile Logging file path. /var/log/aos/rs-server/listener.log

Utility commands Openstack

Note

By default, the output of messages with the level logging WARNING and below is disabled. To enable verbose output, it is needed to set log level and run the command with the --verbose flag.

Authentication mechanism is described in «OpenStackClient Authentication» section.

Database migration

Utility allows to change the structure module database.

During the operation of the utility, the necessary tables are created and the schemes are updated in module database.

Command:

openstack aos db migrate -n rs_server

Creation of TRS instance

Utility allows to create given number of TRS instances.

Command:

openstack aos server create
Utility arguments
Name Description
-h, --help Help output.
--name TRS instance name.
--count Number of creating TRS instances. It is 1 by default.

Example:

# 2 TRS instances named aos-rs-1 and aos-rs-2 will be created
openstack aos server create --name aos-rs --count 2

Output example:

+--------------------------------------------------+---------------------------------------------+
|Field                                             |Value                                        |
+--------------------------------------------------+---------------------------------------------+
|OS-DCF:diskConfig (aos-rs-2)                      |MANUAL                                       |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-AZ:availability_zone (aos-rs-2)            |nova                                         |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:host (aos-rs-2)                   |None                                         |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:hostname (aos-rs-2)               |aos-rs-2                                     |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:hypervisor_hostname (aos-rs-2)    |None                                         |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:instance_name (aos-rs-2)          |                                             |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:kernel_id (aos-rs-2)              |                                             |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:launch_index (aos-rs-2)           |1                                            |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:ramdisk_id (aos-rs-2)             |                                             |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:reservation_id (aos-rs-2)         |r-ma3fq366                                   |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:root_device_name (aos-rs-2)       |None                                         |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:user_data (aos-rs-2)              |None                                         |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-STS:power_state (aos-rs-2)                 |NOSTATE                                      |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-STS:task_state (aos-rs-2)                  |scheduling                                   |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-STS:vm_state (aos-rs-2)                    |building                                     |
+--------------------------------------------------+---------------------------------------------+
|OS-SRV-USG:launched_at (aos-rs-2)                 |None                                         |
+--------------------------------------------------+---------------------------------------------+
|OS-SRV-USG:terminated_at (aos-rs-2)               |None                                         |
+--------------------------------------------------+---------------------------------------------+
|accessIPv4 (aos-rs-2)                             |                                             |
+--------------------------------------------------+---------------------------------------------+
|accessIPv6 (aos-rs-2)                             |                                             |
+--------------------------------------------------+---------------------------------------------+
|addresses (aos-rs-2)                              |                                             |
+--------------------------------------------------+---------------------------------------------+
|config_drive (aos-rs-2)                           |                                             |
+--------------------------------------------------+---------------------------------------------+
|created (aos-rs-2)                                |2018-11-02T08:59:43Z                         |
+--------------------------------------------------+---------------------------------------------+
|description (aos-rs-2)                            |None                                         |
+--------------------------------------------------+---------------------------------------------+
|flavor (aos-rs-2)                                 |                                             |
+--------------------------------------------------+---------------------------------------------+
|hostId (aos-rs-2)                                 |                                             |
+--------------------------------------------------+---------------------------------------------+
|host_status (aos-rs-2)                            |                                             |
+--------------------------------------------------+---------------------------------------------+
|id (aos-rs-2)                                     |254ba49f-584b-419d-9e86-afe9aa8a122e         |
+--------------------------------------------------+---------------------------------------------+
|image (aos-rs-2)                                  |cirros (bdd277be-ebf3-4ff7-8c05-c6f20cbddd61)|
+--------------------------------------------------+---------------------------------------------+
|key_name (aos-rs-2)                               |None                                         |
+--------------------------------------------------+---------------------------------------------+
|locked (aos-rs-2)                                 |False                                        |
+--------------------------------------------------+---------------------------------------------+
|name (aos-rs-2)                                   |aos-rs-2                                     |
+--------------------------------------------------+---------------------------------------------+
|progress (aos-rs-2)                               |0                                            |
+--------------------------------------------------+---------------------------------------------+
|project_id (aos-rs-2)                             |57f4f1cedc4e43c994c41e215bd2ef7c             |
+--------------------------------------------------+---------------------------------------------+
|properties (aos-rs-2)                             |                                             |
+--------------------------------------------------+---------------------------------------------+
|status (aos-rs-2)                                 |BUILD                                        |
+--------------------------------------------------+---------------------------------------------+
|tags (aos-rs-2)                                   |[u'trs']                                     |
+--------------------------------------------------+---------------------------------------------+
|updated (aos-rs-2)                                |2018-11-02T08:59:45Z                         |
+--------------------------------------------------+---------------------------------------------+
|user_id (aos-rs-2)                                |0aa34b274f6a444797fd7f356fd986c2             |
+--------------------------------------------------+---------------------------------------------+
|volumes_attached (aos-rs-2)                       |                                             |
+--------------------------------------------------+---------------------------------------------+
|OS-DCF:diskConfig (aos-rs-1)                      |MANUAL                                       |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-AZ:availability_zone (aos-rs-1)            |nova                                         |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:host (aos-rs-1)                   |None                                         |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:hostname (aos-rs-1)               |aos-rs-1                                     |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:hypervisor_hostname (aos-rs-1)    |None                                         |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:instance_name (aos-rs-1)          |                                             |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:kernel_id (aos-rs-1)              |                                             |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:launch_index (aos-rs-1)           |0                                            |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:ramdisk_id (aos-rs-1)             |                                             |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:reservation_id (aos-rs-1)         |r-ma3fq366                                   |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:root_device_name (aos-rs-1)       |None                                         |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-SRV-ATTR:user_data (aos-rs-1)              |None                                         |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-STS:power_state (aos-rs-1)                 |NOSTATE                                      |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-STS:task_state (aos-rs-1)                  |scheduling                                   |
+--------------------------------------------------+---------------------------------------------+
|OS-EXT-STS:vm_state (aos-rs-1)                    |building                                     |
+--------------------------------------------------+---------------------------------------------+
|OS-SRV-USG:launched_at (aos-rs-1)                 |None                                         |
+--------------------------------------------------+---------------------------------------------+
|OS-SRV-USG:terminated_at (aos-rs-1)               |None                                         |
+--------------------------------------------------+---------------------------------------------+
|accessIPv4 (aos-rs-1)                             |                                             |
+--------------------------------------------------+---------------------------------------------+
|accessIPv6 (aos-rs-1)                             |                                             |
+--------------------------------------------------+---------------------------------------------+
|addresses (aos-rs-1)                              |                                             |
+--------------------------------------------------+---------------------------------------------+
|config_drive (aos-rs-1)                           |                                             |
+--------------------------------------------------+---------------------------------------------+
|created (aos-rs-1)                                |2018-11-02T08:59:43Z                         |
+--------------------------------------------------+---------------------------------------------+
|description (aos-rs-1)                            |None                                         |
+--------------------------------------------------+---------------------------------------------+
|flavor (aos-rs-1)                                 |                                             |
+--------------------------------------------------+---------------------------------------------+
|hostId (aos-rs-1)                                 |                                             |
+--------------------------------------------------+---------------------------------------------+
|host_status (aos-rs-1)                            |                                             |
+--------------------------------------------------+---------------------------------------------+
|id (aos-rs-1)                                     |243c7cc4-12c8-48ed-b128-1934c08765e1         |
+--------------------------------------------------+---------------------------------------------+
|image (aos-rs-1)                                  |cirros (bdd277be-ebf3-4ff7-8c05-c6f20cbddd61)|
+--------------------------------------------------+---------------------------------------------+
|key_name (aos-rs-1)                               |None                                         |
+--------------------------------------------------+---------------------------------------------+
|locked (aos-rs-1)                                 |False                                        |
+--------------------------------------------------+---------------------------------------------+
|name (aos-rs-1)                                   |aos-rs-1                                     |
+--------------------------------------------------+---------------------------------------------+
|progress (aos-rs-1)                               |0                                            |
+--------------------------------------------------+---------------------------------------------+
|project_id (aos-rs-1)                             |57f4f1cedc4e43c994c41e215bd2ef7c             |
+--------------------------------------------------+---------------------------------------------+
|properties (aos-rs-1)                             |                                             |
+--------------------------------------------------+---------------------------------------------+
|status (aos-rs-1)                                 |BUILD                                        |
+--------------------------------------------------+---------------------------------------------+
|tags (aos-rs-1)                                   |[u'trs']                                     |
+--------------------------------------------------+---------------------------------------------+
|updated (aos-rs-1)                                |2018-11-02T08:59:45Z                         |
+--------------------------------------------------+---------------------------------------------+
|user_id (aos-rs-1)                                |0aa34b274f6a444797fd7f356fd986c2             |
+--------------------------------------------------+---------------------------------------------+
|volumes_attached (aos-rs-1)                       |                                             |
+--------------------------------------------------+---------------------------------------------+

Creation of TRS project

Note

Administrator rights are required to create project.

Utility allows to create TRS project.

Command:

openstack aos project create
--name <project_name>
--image <image>
--flavor <flavor>
--network <network>
[--operation_mode <operation_mode>] - if parameter is not specified, then default value is used
[--zone <availability-zone>]
[--domain <domain>]
[--parent <project>]
[--description <description>]
[--enable | --disable]
[--or-show]
[--user-data <script_path>]
[-h, --help]
Utility arguments
Name Description
-h, --help Help output.
--name TRS project name.
--domain Project domain. Name or ID specified.
--image Default image for TRS project. Required parameter, name or ID specified.
--flavor Default flavor for TRS project. Required parameter, name or ID specified.
--network Default network for TRS project. Required parameter, name or ID specified.
--operation_mode

Operation mode of TRS project. Possible values are:

  • 1 - Standard;
  • 2 - Simultaneous.
--zone Default availability zone.
--parent Parent project of TRS project. Name or ID specified.
--description Project description.
--enable Creating project with the status «Enabled». Parameter is set by default.
--disable Creating project with the status «Disabled».
--property Adding parameter <name>. In order to add several parameters at once, option must be repeated.
--or-show Displaying existing project. If project name is duplicated with existing one in domain, project is not created.
--user-data Path to the script that is executed at boot instances of this project.

Example:

openstack aos project create --image cirros --flavor m1.tiny --network provider --name trs_test_project --zone nova

Output example:

+--------------+------------------------------------+
|Field         |Value                               |
+--------------+------------------------------------+
|description   |                                    |
+--------------+------------------------------------+
|domain_id     |default                             |
+--------------+------------------------------------+
|enabled       |True                                |
+--------------+------------------------------------+
|flavor_id     |25a8679f-582a-4f7c-b9c2-286a60bedb76|
+--------------+------------------------------------+
|id            |298276965e964f32a9d8aa60cec8a70c    |
+--------------+------------------------------------+
|image_id      |bdd277be-ebf3-4ff7-8c05-c6f20cbddd61|
+--------------+------------------------------------+
|is_domain     |False                               |
+--------------+------------------------------------+
|name          |trs_test_project                    |
+--------------+------------------------------------+
|network_id    |5f83ab2d-3ef1-4f16-a527-4ea8a9b5f141|
+--------------+------------------------------------+
|operation_mode|1                                   |
+--------------+------------------------------------+
|parent_id     |default                             |
+--------------+------------------------------------+
|tags          |[u'trs']                            |
+--------------+------------------------------------+

Hint

  • The newly created TRS project has no users or groups assigned to it. For this reason, after creating project, it is necessary to assign users to it using the standard command OpenStack:

    openstack role add --user USER_NAME --project TENANT_ID ROLE_NAME
    
  • It is also possible to assign users group to project using standard command OpenStack:

    openstack role add --group GROUP_NAME --project TENANT_ID ROLE_NAME
    

Automatic allocation of free instances

Utility allows to automatically distribute free instances of the project to users.

Command:

openstack aos project auto-allocate-users --project <project>
Utility arguments
Name Description
-h, --help Help output.
--project TRS project name or ID.

Example:

openstack aos project auto-allocate-users --project trs1

Output of instances list by type

Utility allows to list of instances, filtering them by type: TRS, typical or baremetal.

Command:

openstack aos server list

Utility uses same parameters as for the built-in openstackclient command server list.

Utility arguments
Name Description
-h, --help Help output.
--type

Instance type for displaying (by default all). Possible values are:

  • typical;
  • trs.

Example:

# output of all TRS instances in all projects
openstack aos server list --all-projects --type trs

Output example:

+--------------------------------------+-------------------+-----------+-----------------------+----------+-------+---------+-------+-------+--------------+----------------+
| ID                                   | Name              | Project   | IP Address            | Size     | Type  | Status  | Zone  | Task  | Power State  | Operation mode |
+--------------------------------------+-------------------+-----------+-----------------------+----------+-------+---------+-------+-------+--------------+----------------+
| 2eb9c697-0ddb-4979-b61e-6677e0636e51 | test_trs_vm1      | test_trs1 | localnet=192.168.2.10 | m1.tiny  | TRS   | ACTIVE  | nova  | None  | Running      | 1              |
| 38809de6-ad7e-4865-9f85-cd03c25e3e4b | test_trs_vm2      | test_trs1 | localnet=192.168.2.9  | m1.tiny  | TRS   | ACTIVE  | nova  | None  | Running      | 1              |
| 6e2a7fdc-2af9-47b9-9f3e-936aecadbf9d | test_trs_vm3      | test_trs1 | localnet=192.168.2.8  | m1.tiny  | TRS   | ACTIVE  | nova  | None  | Running      | 1              |
| 3e407223-6fd6-4bb5-ae89-6bbdf70afb12 | test_trs_vm10     | test_trs2 | provider=10.35.207.69 | m1.tiny  | TRS   | ACTIVE  | nova  | None  | Running      | 2              |
| 159d7530-29a2-44fe-a21d-d489daa3602b | test_trs_vm111    | test_trs2 | provider=10.35.207.68 | m1.tiny  | TRS   | ACTIVE  | nova  | None  | Running      | 2              |
| 9c64bb3a-1df9-4f07-955d-c60fca3bde9f | test_trs_vm4      | test_trs1 | localnet=192.168.2.6  | m1.tiny  | TRS   | ACTIVE  | nova  | None  | Running      | 1              |
| d36ca2db-7f97-44f3-b2c6-f2a5a73a1174 | test_trs_vm5      | test_trs1 | localnet=192.168.2.5  | m1.tiny  | TRS   | PAUSED  | nova  | None  | Paused       | 1              |
+--------------------------------------+-------------------+-----------+-----------------------+----------+-------+---------+-------+-------+--------------+----------------+

Creating assignment between users and TRS instances in current domain

Utility allows to create assignment between users and TRS instances.

Command:

openstack aos assignment add
Utility arguments
Name Description
-h, --help Help output.
--instance UUID of TRS instance to assign. Required parameter.
--user ID or username to assign.
--group ID or name of users group to assign.

Example of creating assignment between user and TRS instance in current domain by username and UUID of instance:

openstack aos assignment add --user admin --instance 2981823a-c11e-41cd-8140-5fe6902f4e4e

Output example:

Created user assignment.

Example of creating assignment between users group and TRS instance in current domain by users group name and UUID of instance:

openstack aos assignment add --group managers --instance 8370524f-f46c-47f5-9075-c0cef7fbc52c

Output example:

Created user group assignment.

Output of list all assignments between users and TRS instances in current domain

Utility allows to display list of all assignments between users and TRS instances, filtering them by parameters: instance, user, group and project.

Command:

openstack aos assignment list
Utility arguments
Name Description
-h, --help Help output.
--instance Filter by UUID of instance. Optional parameter.
--user Filter by ID or username. Optional parameter. It can be used with parameter --project.
--group Filter by ID or users group. Optional parameter. It can be used with parameter --project.
--project Filter by ID or project name. Optional parameter. It can be used with parameters --user and --group.

Example of getting list of assigned to a given user TRS instances by username:

openstack aos assignment list –user demo

Output example:

+--+--------------------------------+--------+------------------------------------+------------------------------------+
|ID|User_id                         |Username|Instance_uuid                       |Instance name                       |
+--+--------------------------------+--------+------------------------------------+------------------------------------+
|30|4624d46153f04fdb963a16754f8b5d0a|demo    |2981823a-c11e-41cd-8140-5fe6902f4e4e|e56859b8-bdb2-4655-afcc-2b0a9a776975|
+--+--------------------------------+--------+------------------------------------+------------------------------------+
|31|4624d46153f04fdb963a16754f8b5d0a|demo    |8370524f-f46c-47f5-9075-c0cef7fbc52c|trs2_2018-06-21_16:15:48            |
+--+--------------------------------+--------+------------------------------------+------------------------------------+

Example of getting list of assigned to given user within given project TRS instances by user ID and project name:

openstack aos assignment list --user demo --project demo

Output example:

+--+--------------------------------+--------+------------------------------------+------------------------------------+
|ID|User_id                         |Username|Instance_uuid                       |Instance name                       |
+--+--------------------------------+--------+------------------------------------+------------------------------------+
|30|4624d46153f04fdb963a16754f8b5d0a|demo    |2981823a-c11e-41cd-8140-5fe6902f4e4e|e56859b8-bdb2-4655-afcc-2b0a9a776975|
+--+--------------------------------+--------+------------------------------------+------------------------------------+
|31|4624d46153f04fdb963a16754f8b5d0a|demo    |8370524f-f46c-47f5-9075-c0cef7fbc52c|trs2_2018-06-21_16:15:48            |
+--+--------------------------------+--------+------------------------------------+------------------------------------+

Example of getting list of assigned to given instance users by instance name:

openstack aos assignment list --instance 2981823a-c11e-41cd-8140-5fe6902f4e4e

Output example:

+--+--------------------------------+--------+------------------------------------+------------------------------------+
|ID|User_id                         |Username|Instance_uuid                       |Instance name                       |
+--+--------------------------------+--------+------------------------------------+------------------------------------+
|30|4624d46153f04fdb963a16754f8b5d0a|demo    |2981823a-c11e-41cd-8140-5fe6902f4e4e|e56859b8-bdb2-4655-afcc-2b0a9a776975|
+--+--------------------------------+--------+------------------------------------+------------------------------------+
|32|a198a0379e034a61b4a98167057b728a|admin   |2981823a-c11e-41cd-8140-5fe6902f4e4e|e56859b8-bdb2-4655-afcc-2b0a9a776975|
+--+--------------------------------+--------+------------------------------------+------------------------------------+

Deleting assignment between users and TRS instances in current domain

Utility allows to delete assignment between users and TRS instances.

Command:

openstack aos assignment delete
Utility arguments
Name Description
-h, --help Help output.
--instance <instance> UUID of TRS instance. Required parameter.
--user <user> Username or ID. Required parameter, if no group is specified.
--group <group> Group name or ID. Required parameter, if no user is specified.

Example of deleting assignment between user and TRS instance in the current domain by username and UUID of instance:

openstack aos assignment delete --user admin --instance 2981823a-c11e-41cd-8140-5fe6902f4e4e

Output example:

User assignment successfully deleted.

Example of deleting assignment between users group and TRS instance in the current domain by group name and UUID of instance:

openstack aos assignment add --group managers --instance 8370524f-f46c-47f5-9075-c0cef7fbc52c

Output example:

Group assignment successfully deleted.