An agent for collecting vSphere inventory data and reporting to the Migration Planner console.
make buildThis produces the binary at bin/agent.
bin/agent run --agent-id <uuid> --source-id <uuid>Both --agent-id and --source-id are required and must be valid UUIDs.
Run in disconnected mode (default):
bin/agent run \
--agent-id 550e8400-e29b-41d4-a716-446655440000 \
--source-id 6ba7b810-9dad-11d1-80b4-00c04fd430c8Run in connected mode with authentication:
bin/agent run \
--agent-id 550e8400-e29b-41d4-a716-446655440000 \
--source-id 6ba7b810-9dad-11d1-80b4-00c04fd430c8 \
--mode connected \
--authentication-enabled \
--authentication-jwt-filepath /path/to/jwtRun in production mode with persistent storage:
bin/agent run \
--agent-id 550e8400-e29b-41d4-a716-446655440000 \
--source-id 6ba7b810-9dad-11d1-80b4-00c04fd430c8 \
--server-mode prod \
--server-statics-folder /var/www/statics \
--data-folder /var/lib/agent| Flag | Default | Description |
|---|---|---|
--agent-id |
required | Unique identifier (UUID) for this agent |
--source-id |
required | Source identifier (UUID) for this agent |
--mode |
disconnected |
connected | disconnected |
--data-folder |
— | Path to persistent data folder (uses in-memory if not set) |
--opa-policies-folder |
— | Path to OPA policies folder for VM validation |
--num-workers |
3 |
Number of scheduler workers |
--version |
v0.0.0 |
Agent version to report to console |
--legacy-status-enabled |
true |
Use legacy status like waiting-for-credentials |
--server-http-port |
8000 |
HTTP server port |
--server-mode |
dev |
dev | prod (prod enables HTTPS with self-signed certs) |
--server-statics-folder |
— | Path to static files (required when --server-mode=prod) |
--console-url |
http://localhost:7443 |
Migration planner console URL |
--console-update-interval |
5s |
Status update interval |
--authentication-enabled |
true |
Enable console authentication |
--authentication-jwt-filepath |
— | Path to JWT file (required when --authentication-enabled) |
--log-format |
console |
console | json |
--log-level |
debug |
debug | info | warn | error |
Run tests:
make testRun linter:
make lintFormat code:
make formatRun all validations:
make validate-allTo test the agent against the staging backend, you need to generate a JWT token and run the agent with authentication enabled.
Use the migration-planner CLI to generate a JWT:
../migration-planner/bin/planner sso token \
--org 12345678 \
--private-key ./privatekey \
--username your-username \
--source-id <source-uuid> \
--kid <key-id> > ./jwtThe --agent-id can be any valid UUID. Generate one with uuidgen.
bin/agent run \
--legacy-status-enabled \
--agent-id $(uuidgen) \
--source-id <source-uuid> \
--data-folder . \
--authentication-enabled \
--authentication-jwt-filepath ./jwt \
--console-url https://console.stage.redhat.com/api/migration-assessment/