How to manage VMs, images, and slots via CLI in KATA SB [KATA/KEDRE]
KATA Sandbox provides instruments to manage SB images, ISO files, and VM Slots number via CLI. For details, see below.
Slots
Sometimes, it is convenient to change a slot number via CLI. To do so, become a root user and run:
/opt/kaspersky/sandbox/bin/sandbox-slots-setup <number of slots>
# /opt/kaspersky/sandbox/bin/sandbox-slots-setup 12
|
Images
ISOs can be managed using the sb-vm-iso tool.
# sb-vm-iso
Usage:
--list-iso
--state [<iso-name>]
--install <iso-name>
--check-install <iso-name>
--remove <iso-name>
--add <iso-path>
# sb-vm-iso --list-iso
{"iso": ["sandbox-images-centos7_x64-1.0.0.19888.x86_64.iso", "sandbox-images-win10_x64-1.1.0.18829-vl.x86_64.iso"]}
|
VMs
VM management is done using the sb-vms tool.
# sb-vms
Usage:
--list-vms
--list-non-activated
--activate <vm_id> '[{"id": "<component-id>", "key": "<component-key>"} ]'
--apply-all
--reset
--remove <vm_id>
# sb-vms --list-vms
{"vms": [{"id": "CentOS7_x64-1.0.0.19888", "name": "CentOS7_x64-1.0.0.19888", "status": "installed", "description": ""}, {"id": "Win10_x64-1.1.0.18829", "name": "Win10_x64-1.1.0.18829", "status": "installed", "description": ""}]}
|
VMs removal using sb-vms tool
VMs removal
Counterintuitively, using IDs obtained by "sb-vms --list-vms" for "sb-vms --remove" doesn't work.
Obtain the IDs from kata_scanner etcd on Central node instead of using apt-settings-manager:
# apt-settings-manager get /configuration/kata_scanner | python -m json.tool | grep images -A5
"images": [
"CentOS7_x64",
"Win7_x64",
"Win10_x64",
"WinXP"
],
|
To remove images one by one:
# sb-vms --remove CentOS7_x64
# sb-vms --remove WinXP
# sb-vms --remove Win7_x64
# sb-vms --remove Win10_x64
|
Same principle for 5+/6+: obtain the IDs from kata_scanner etcd on Central node using console-settings-updater :
# console-settings-updater get /kata/configuration/product/kata_scanner | python3 -m json.tool | grep images -A6
"images": [
"Astra_x64",
"CentOS7_x64",
"Win7_x64",
"Win10_x64",
"WinXP"
],
|
To remove images one by one:
# sb-vms --remove Astra_x64
# sb-vms --remove CentOS7_x64
# sb-vms --remove WinXP
# sb-vms --remove Win7_x64
# sb-vms --remove Win10_x64
|
0 Comments
Recommended Comments
There are no comments to display.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now