Platform management

ioxclient also provides CLIs to view and manage platform related information. Here are the list of platform commands:

~$ ioxclient  platform
NAME:
   ioxclient platform - Manage IOx platform

USAGE:
   ioxclient platform command [command options] [arguments...]

COMMANDS:
   resourcemanager, rsmgr	View resource manager information
   docker-opts, d	        Query the platform for supported docker runtime options
   autoconfigcli, ac		Auto configure IOS CLI support
   tech-support, ts		Manage techsupport snapshots
   certificate, cert		Manage CA-signed certificate on the platform
   signedpackages, signpkg	Enable/Disable package signature validation on the platform
   device, dvc			Manage serial/usb devices on this platform
   network, nw			Manage logical networks on the platform
   core, core			Manage core files on the platform
   logs, logs			Manage platform log files
   diagnostics, diag		Get platform diagnostics
   capability, cap		Get platform capability info
   cafmetrics, cafmet		Get CAF metrics
   reset, rset			IOX reset. Reset IOX to factory defaults
   events, ev			Get platform events
   errors, err			Get platform errors
   health, hlt			Get platform health info
   info, inf			Get platform info
   scp, scp			SCP a file to IOx device
   help, h			Shows a list of commands or help for one command

OPTIONS:
   --help, -h           show help
   --generate-bash-completion   

Get Platform Docker Runtime Options

ioxclient provides a command to get or query platform for supported docker runtime options.


dev:~/Documents/cisco/iox_apps/> ioxclient platform docker-opts --options "--rm"
Currently active profile :  UmangCallisto
Command Name:  plt-docker-opts
Response from the device: 
{
 "supported_host_mount_paths": [
  "/software/caf/app_data_share",
  "/var/app_tmpfs"
 ],
 "supported_options": [
  "ipc",
  "oom-score-adj",
  "env",
  "log-driver",
  "net-alias",
  "u",
  "w",
  "v",
  "stop_timeout",
  "mount",
  "e"
 ],
 "validation_status": {
  "error_msg": "",
  "input_options": "\"--rm\"",
  "is_valid": true,
  "un_supported_options": []
 }

View resource manager data

CAF has an internal resource manager responsible for allocating and keeping track of resources such as cpu, memory, disk, serial devices etc., to applications.

View Resource Profile definitions

A Resource Profile encapsulates a set of resources (cpu, memory etc.,) under a unique name in a consistent fashion across all cisco's IOx platforms. To see the supported resource profile definitions and their values:

$ ioxclient platform  resourcemanager profiles
Currently using profile :  local
Command Name: plt-rsmgr-profiles
Profile Definitions :
-----------------------------
{
 "c1.large": {
  "cpu": 600,
  "memory": 256,
  "vcpu": 1
 },
 "c1.medium": {
  "cpu": 400,
  "memory": 128,
  "vcpu": 1
 },
 "c1.small": {
  "cpu": 200,
  "memory": 64,
  "vcpu": 1
 },
 "c1.tiny": {
  "cpu": 100,
  "memory": 32,
  "vcpu": 1
 },
 "c1.xlarge": {
  "cpu": 1200,
  "memory": 256,
  "vcpu": 1
 },
 "default": {
  "cpu": 200,
  "memory": 64,
  "vcpu": 1
 }
}

View resource allocation information

It is possible to view the inventory of resources and allocations maintained by resource manager.

$ ioxclient platform resourcemanager allocations
Currently using profile :  local
Command Name: plt-rsmgr-allocations
Resource Allocation Info :
-----------------------------
{
"cpu": {
 "app_cpu_allocations": [
  {
   "py": 600
  },
  {
   "sim": 200
  }
 ],
 "available_cpu": 200,
 "total_cpu": 1000
},
"devices": {
 "app_device_mapping": []
},
"disk": {
 "app_disk_allocations": [
  {
   "py": 10
  },
  {
   "sim": 30
  }
 ],
 "available_persistent_disk": 216,
 "total_persistent_disk": 256
},
"memory": {
 "app_memory_allocations": [
  {
   "py": 256
  },
  {
   "sim": 64
  }
 ],
 "available_memory": 4800,
 "total_memory": 5120
}
}

Manage techsupport snapshots on the device

Techsupport snapshots are basically archive files that contain critical platform logs, statistics about platform health etc., These files can be used to analyze and troubleshoot any issues on the platform.

Techsupport commands are as below:

~$ ioxclient  platform techsupport
NAME:
   ioxclient platform techsupport - Manage techsupport snapshots

USAGE:
   ioxclient platform techsupport command [command options] [arguments...]

COMMANDS:
   list, li		List all existing techsupport files
   create, c		Create a new techsupport snapshot file
   delete, d		Delete a techsupport snapshot file
   download, dnld	Download a techsupport snapshot file
   help, h		Shows a list of commands or help for one command

OPTIONS:
   --help, -h			show help
   --generate-bash-completion

Create a techsupport snapshot

~$ ioxclient  platform techsupport create
Currently using profile :  default
Command Name: plt-ts-create
A new techsupport snapshot has been generated. File name is  tech_support_2016-01-08_04.00.55.tar.gz

List techsupport files on the platform

~$ ioxclient platform techsupport list
Currently using profile :  default
Command Name: plt-ts-list
List of techsupport files on the system :
1  ---> tech_support_2016-01-08_04.00.55.tar.gz
2  ---> tech_support_2016-01-05_14.35.41.tar.gz
3  ---> tech_support_2016-01-05_13.42.14.tar.gz
4  ---> tech_support_2016-01-05_14.30.04.tar.gz
5  ---> tech_support_2016-01-07_10.22.56.tar.gz
6  ---> tech_support_2016-01-05_14.34.51.tar.gz
7  ---> tech_support_2016-01-05_14.34.15.tar.gz
8  ---> tech_support_2016-01-05_13.11.08.tar.gz
9  ---> tech_support_2016-01-05_14.05.59.tar.gz

Download a techsupport snapshot

~$ ioxclient  platform techsupport download
Currently using profile :  default
Command Name: plt-ts-download
List of techsupport files in the system :
1  ---> tech_support_2016-01-08_04.00.55.tar.gz
2  ---> tech_support_2016-01-05_14.35.41.tar.gz
3  ---> tech_support_2016-01-05_13.42.14.tar.gz
4  ---> tech_support_2016-01-05_14.30.04.tar.gz
5  ---> tech_support_2016-01-07_10.22.56.tar.gz
6  ---> tech_support_2016-01-05_14.34.51.tar.gz
7  ---> tech_support_2016-01-05_14.34.15.tar.gz
8  ---> tech_support_2016-01-05_13.11.08.tar.gz
9  ---> tech_support_2016-01-05_14.05.59.tar.gz
Choose the file (1:9) : 1
Read bytes :  3205206
Techsupport snapshot successfully downloaded at  tech_support_2016-01-08_04.00.55.tar.gz

Deleting a techsupport snapshot

~$ ioxclient  platform techsupport delete
Currently using profile :  default
Command Name: plt-ts-delete
List of techsupport files in the system :
1  ---> tech_support_2016-01-08_04.00.55.tar.gz
2  ---> tech_support_2016-01-05_14.35.41.tar.gz
3  ---> tech_support_2016-01-05_13.42.14.tar.gz
4  ---> tech_support_2016-01-05_14.30.04.tar.gz
5  ---> tech_support_2016-01-07_10.22.56.tar.gz
6  ---> tech_support_2016-01-05_14.34.51.tar.gz
7  ---> tech_support_2016-01-05_14.34.15.tar.gz
8  ---> tech_support_2016-01-05_13.11.08.tar.gz
9  ---> tech_support_2016-01-05_14.05.59.tar.gz
Choose the file (1:9) : 1
Tech support file tech_support_2016-01-08_04.00.55.tar.gz successfully deleted