This repository provides a features of collection and aggregation for all source computing information. This is a sub-system on Cloud-Barista platform and utilizes CM-Beetle to migrate a multi-cloud.
Collecting and Aggregating Information From Source Computing framework (codename: cm-honeybee) is going to support:
1.1. Write the configuration file. (Optional)
(You can skip this step and the default settings will be used instead.)
cm-honeybee:
listen:
port: 8081
agent:
port: 8082
1.2. Build and run the server binary
cd server
make run
Or, you can run it within Docker by this command.
make run_docker
Check your source group ID (sgID) after register.
curl -X 'POST' \
'http://127.0.0.1:8081/honeybee/source_group' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"description": "test migration group",
"name": "test-group"
}'
{
"id": "b9e86d53-9fbe-4a96-9e06-627f77fdd6b7",
"name": "test-group",
"description": "test migration group",
"connection_info_status_count": {
"count_connection_success": 0,
"count_connection_failed": 0,
"count_agent_success": 0,
"count_agent_failed": 0,
"connection_info_total": 0
}
}
Register the connection information to the source group. Agent will be installed automatically.
curl -X 'POST' \
'http://127.0.0.1:8081/honeybee/source_group/b9e86d53-9fbe-4a96-9e06-627f77fdd6b7/connection_info' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{ "description": "NFS Server", "ip_address": "172.16.0.123", "name": "cm-nfs", "password": "some_pass", "private_key": "-----BEGIN RSA PRIVATE KEY-----\n******\n-----END RSA PRIVATE KEY-----", "ssh_port": 22, "user": "ubuntu" }'
{
"id": "2f678139-e6e6-43e8-9722-33b834efc563",
"name": "cm-nfs",
"description": "NFS Server",
"source_group_id": "b9e86d53-9fbe-4a96-9e06-627f77fdd6b7",
"ip_address": "172.16.0.123",
"ssh_port": "XXXXXXXX...=",
"user": "XXXXXXXX...=",
"password": "XXXXXXXX...=",
"private_key": "XXXXXXXX...=",
"public_key": "",
"connection_status": "success",
"connection_failed_message": "",
"agent_status": "success",
"agent_failed_message": ""
}
Below example is saving infrastructure information of all connection in the source group.
curl -X 'POST' \
'http://127.0.0.1:8081/honeybee/source_group/b9e86d53-9fbe-4a96-9e06-627f77fdd6b7/import/infra' \
-H 'accept: application/json'
Below example is getting saved infrastructure information of all connection in the source group.
curl -X 'GET' \
'http://127.0.0.1:8081/honeybee/source_group/b9e86d53-9fbe-4a96-9e06-627f77fdd6b7/infra' \
-H 'accept: application/json'
Below example is getting refined, saved infrastructure information of all connection in the source group.
curl -X 'GET' \
'http://127.0.0.1:8081/honeybee/source_group/b9e86d53-9fbe-4a96-9e06-627f77fdd6b7/infra/refined' \
-H 'accept: application/json'
Check if CM-Honeybee server is running
curl http://localhost:8081/honeybee/readyz
# Output if it's running successfully
# {"message":"CM-Honeybee API server is ready"}
Check if CM-Honeybee agent is running
curl http://localhost:8081/honeybee/readyz
# Output if it's running successfully
# {"message":"CM-Honeybee Agent API server is ready"}
There are default private key and public key used for encrypt connection info's secret values (ssh port, user, password, private key) from the honeybee server. (Located in server/_default_key) For security, run these commands to generate new key files.
docker exec cm-honeybee rm /root/.cm-honeybee/honeybee.key
docker exec cm-honeybee rm /root/.cm-honeybee/honeybee.pub
docker restart cm-honeybee
If you want to use private key file with other modules like cm-grasshopper, run this command.
mkdir keys
docker cp cm-honeybee:/root/.cm-honeybee/honeybee.key keys/
docker cp cm-honeybee:/root/.cm-honeybee/honeybee.pub keys/
Now, mount the created folder to the honeybee server container. For docker compose, add these lines.
volumes:
- ./keys/honeybee.key:/root/.cm-honeybee/honeybee.key
- ./keys/honeybee.pub:/root/.cm-honeybee/honeybee.pub
Now, you can copy ./keys/honeybee.key file to other module.
Those encrypted values are always changes with each request by RSA algorithm.
cd server
make run
honeybee.key
file from ~/.cm-honeybee
or the path of 'CMHONEYBEE_ROOT' environment variable.