Importing equipment into the platform
You can import equipment into the platform using the migration script. Read more about migration in Migration from DCImanager 5 to DCImanager 6.
Import consists of the following steps:
- Preparing a JSON file with a description of the equipment.
- Preparing a configuration file for the migration script.
- Running the script in import mode.
Import procedure
- Connect to the server with DCImanager via SSH with superuser permissions.
Enter the migrator container:
docker exec -it migrator bash
BASHEnter the migration service directory:
cd /opt/ispsystem/migrate
BASHTo import servers, create the /opt/ispsystem/migrate/server.json file in the following format:
Example of file
[ { "name":"Server 1", "platform":"Platform 1", "configuration":"i9-9900K-64Gb-1024NVMe-2048NVMe", "mac":"AA:BB:CC:DD:EE:FF", "owner":"admin@example.com", "blocked":false, "installed_os":"", "note":"Some comment", "rack": "Rack 1", "unit":1, "chassis": null, "slot": null }, { "name:"Server 2", ... ]
YMLCommentsname — server name
platform — platform name in DCImanager
configuration — server configuration. Can be a blank line
mac — MAC address of the server. Can be a blank line
owner — email of DCImanager user — the server owner. Can be a blank line
blocked — mark the server as locked. Read more in Locking a server. Possible values: true — locked, false — unlocked
installed_os — discretionary name of the OS installed on the server
note — discretionary comment
rack — name of rack in DCImanager. Specify null for the blade server
unit — unit number in the rack. Specify null for the blade server
chassis — chassis name. If it is not a blade server, specify null
slot — slot number in chassis. If it is not a blade server, specify null
To import switches, create the /opt/ispsystem/migrate/switch.json file in the following format:
Example of file
[ { "name": "Switch 1", "device": "arista_eapi", "ip": "192.0.2.100", "rack": "Rack 1", "unit": 1, "size": 1, "note": "Some comment", "couple_switch": null, "snmp_params": null, "netconf_params": null, "telnet_params": null, "nxapi_params": null, "eapi_params": {"password": "secret", "username": "admin"} }, { "name:"Switch 2", ... ]
YMLCommentsname — switch name
device — internal device name
ip — switch IP address
rack — rack name in DCImanager
size — switch size in rack units. The minimum value is 0
note — discretionary comment.
couple_switch — name of the paired switch. If you create VLANs on the switch you are adding, they will automatically be created on the paired switch. If there is no paired switch, specify null
snmp_params — SNMP connection parameters. If the switch uses a different protocol, specify null
netconf_params — Netconf connection parameters. If the switch uses a different protocol, specify null
telnet_params — SSH connection parameters. If the switch uses a different protocol, specify null
nxapi_params — NxAPI connection parameters. If the switch uses a different protocol, specify null
eapi_params — eAPI connection parameters. If the switch uses a different protocol, specify null
To get the internal name of the handler, open the Swagger interface → Equipment service → execute a GET request supported_switch. The response to the request will contain the names of the handlers in the handler parameter. Read more about switch handlers in Supported devices.
To get the switch connection settings, open the Swagger interface → DCI Back → copy the required data from the POST request parameter switch. For example, for eapi_params, you need to specify:"eapi_params": { "password": "<password>", "username": "<username>" }
YMLFor telnet_params, use the data from ssh_params:
"ssh_params": { "password": "<password>", "port": <port>, "user": "<username>" }
YMLCreate import_settings.yaml configuration file for the migration:
action: import platform: dci6 data: - server - switch transport: - type: dci6_http - type: dci6_auth_http location: 1 format: json debug: false log_file: /var/log/migrate.log report_file: import_report_{datetime}.txt report_view: plain
YMLSpecify the location id in the location parameter.
If you do not plan to import servers, delete the "- server" line from the file.
If you do not plan to import switches, delete the "- switch" line from the file.
Run the script to import the data:
python3 migrator.py -p import_settings.yaml
BASH
Diagnostics
Migration logs are written to the /var/log/migrate.log file in the migrator container on the server with DCImanager 6. The migration report is saved to the file specified in the report_file parameter of the migration configuration file.