intelsdi-x/snap-plugin-collector-scaleio

Scale IO telemetry task create fails with required key missing

Closed this issue · 5 comments

Snap daemon version (use snapteld -v):

root@b20b582634a0:/src/snapd# ./snapteld -v
snapteld version 1.0.0
root@b20b582634a0:/src/sna

Environment:

  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release): Ubuntu 15.10
  • Kernel (e.g. uname -a):
    Linux b20b582634a0 4.8.0-34-generic #36-Ubuntu SMP Wed Dec 21 17:24:18 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  • Relevant tools (e.g. plugins used with Snap):
root@ced81655974c:/src/snapd# ./snaptel plugin list
NAME 		 VERSION 	 TYPE 		 SIGNED 	 STATUS 	 LOADED TIME
elasticsearch 	 4 		 collector 	 false 		 loaded 	 Mon, 16 Jan 2017 01:49:48 UTC
mongodb 	 2 		 collector 	 false 		 loaded 	 Mon, 16 Jan 2017 01:49:48 UTC
psutil 		 9 		 collector 	 false 		 loaded 	 Mon, 16 Jan 2017 01:49:48 UTC
scaleio 	 1 		 collector 	 false 		 loaded 	 Mon, 16 Jan 2017 01:49:49 UTC
file 		 2 		 publisher 	 false 		 loaded 	 Mon, 16 Jan 2017 01:49:49 UTC
cassandra 	 3 		 collector 	 false 		 loaded 	 Mon, 16 Jan 2017 01:49:47 UTC
root@ced81655974c:/src/snapd#
  • Others (e.g. deploying with Ansible):

What happened:

root@37714a74d115:/src/snapd# ./snaptel task create -t ./m2.json 
Using task manifest to create task
Error creating task:required key missing (gateway)
required key missing (username)
required key missing (password)
required key missing (verifySSL)

What you expected to happen:
Task should have been created.

Steps to reproduce it (as minimally and precisely as possible):

  1. run snapteld version 1.0.0 with latest scale io collector plugin.
  2. Using the following JSON to create the task.
{
    "version": 1,
    "schedule": {
        "type": "simple",
        "interval": "10s"
    },
    "max-failures": 10,
    "workflow": {
        "collect": {
            "metrics": {
                "/intel/scaleio/*/pendingMovingOutBckRebuildJobs": {},
                "/intel/scaleio/*/snapCapacityInUseInKb": {},
                "/intel/scaleio/*/bckRebuildWriteBwc/numOccured": {}
            },
            "config": {
		"/intel/scaleio": { 
                    "username": "monitor_only",
                    "password": "Fakepassword",
                    "gateway": "https://my-cluster",
                    "verifySSL": "false"
		}
            },
	   "publish": [
                        {
                            "plugin_name": "file",                            
                            "config": {
                                "file": "/tmp/snap_published_scaleio_file.log"
                            }
                        }
           ]
        }
    }
}

Anything else do we need to know (e.g. issue happens only occasionally):

Thanks for opening this @rvvzuser. I ran locally and verified on both releases (alpha and 1) that the same behavior occurs. Existing example does not load either nor this simple one I used:

{
    "version": 1,
    "schedule": {
        "type": "simple",
        "interval": "10s"
    },
    "max-failures": 10,
    "workflow": {
        "collect": {
            "metrics": {
                "/intel/scaleio/*/pendingMovingOutBckRebuildJobs": {},
                "/intel/scaleio/*/snapCapacityInUseInKb": {},
                "/intel/scaleio/*/bckRebuildWriteBwc/numOccured": {}
            },
            "config": {
                "/intel/scaleio": {
                    "username": "admin",
                    "password": "password",
                    "gateway": "https://my-cluster",
                    "verifySSL": false
                }
            }
        }
    }
}

FYI to whoever can take it from here. cc @thomastaylor312 since I believe you wrote this!

@mbbroberg, @rvvzuser: The issue with the given task is that the config for this plugin has been defined to be set in the plugin config rather than the task config. You can try starting snapteld with this config file:

config.yaml

---                                                                                                                                                                                                                
control:                                                                                                                                                                                                           
  plugins:                                                                                                                                                                                                         
    all:                                                                                                                                                                                                           
      password: "password"                                                                                                                                                                                         
      gateway: "test"                                                                                                                                                                                              
      verifySSL: false                                                                                                                                                                                             
      username: "testname"                                                                                                                                                                                         
    collector:                                                                                                                                                                                                     
      scaleio:                                                                                                                                                                                                     
        all:                                                                                                                                                                                                       
                password: "password"                                                                                                                                                                               
                gateway: "test"                                                                                                                                                                                    
                verifySSL: false                                                                                                                                                                                   
                username: "testname" 

using snapteld --config config.yaml and you should be able to start your task. This enabled me to get past the errors you were seeing. The example config appears to be incorrect and needs to be updated. I'm not sure if it would make more sense to update the plugin to use the task specific config or continue using plugin config and update the example.

@rvvzuser: Can you verify that you can get your task to work using the snapteld config above and provide input on which option you think is a more consistent fix for this? cc @thomastaylor312.

I'm still curious what the best option is to move forward. Any thoughts @rvvzuser?

let me try this configuration.

@rvvzuser , were you able to create tasks using the configuration that @IRCody has suggested?