Tendrl / gluster-integration

Extracts all data from a Gluster cluster for consumption by Tendrl
GNU Lesser General Public License v2.1
6 stars 20 forks source link

StartProfiling flow doesn't work as expected #591

Closed nthomas-redhat closed 6 years ago

nthomas-redhat commented 6 years ago

Setup: Two node cluster with a single volume whose profiling is not enabled Result: During import the top level flag is updated to 'enabled . It changes the profiling of the volume as expected but the job fails and the flag at the volume level is updated properly

Job output:

{ "action": "get", "node": { "key": "/queue/68743694-d32d-49a4-ae50-a693dfdbe6f6", "dir": true, "nodes": [ { "key": "/queue/68743694-d32d-49a4-ae50-a693dfdbe6f6/locked_by", "value": "{\"node_id\": \"68c6a141-5978-4d29-a5df-c7a1d4d564f4\", \"type\": \"sds\", \"fqdn\": \"dhcp43-201.lab.eng.blr.redhat.com\", \"tags\": [\"provisioner/9f02935f-52c1-4edf-bafd-a94d055943f8\", \"tendrl/integration/gluster\", \"gluster/server\", \"tendrl/integration/9f02935f-52c1-4edf-bafd-a94d055943f8\", \"detected_cluster/28f6abf0c644d0b92363ce3ec6d8a424244f3159f2562bd840cebd4c9b367be3\", \"tendrl/node_68c6a141-5978-4d29-a5df-c7a1d4d564f4\", \"tendrl/node\"]}", "modifiedIndex": 45426, "createdIndex": 45426 }, { "key": "/queue/68743694-d32d-49a4-ae50-a693dfdbe6f6/errors", "value": "Traceback (most recent call last):\n File \"/usr/lib/python2.7/site-packages/tendrl/commons/jobs/init.py\", line 219, in process_job\n the_flow.run()\n File \"/usr/lib/python2.7/site-packages/tendrl/gluster_integration/objects/volume/flows/start_profiling/init.py\", line 12, in run\n vol_id=self.parameters['Volume.vol_id']\nKeyError: 'Volume.vol_id'\n", "modifiedIndex": 45419, "createdIndex": 45419 }, { "key": "/queue/68743694-d32d-49a4-ae50-a693dfdbe6f6/hash", "value": "9be0de69dd07e98a2d6dcbf87f31532f", "modifiedIndex": 45423, "createdIndex": 45423 }, { "key": "/queue/68743694-d32d-49a4-ae50-a693dfdbe6f6/status", "value": "failed", "modifiedIndex": 45416, "createdIndex": 45416 }, { "key": "/queue/68743694-d32d-49a4-ae50-a693dfdbe6f6/payload", "value": "{\"status\": \"new\", \"username\": \"admin\", \"run\": \"gluster.objects.Volume.flows.StartProfiling\", \"job_id\": \"68743694-d32d-49a4-ae50-a693dfdbe6f6\", \"parameters\": {\"Volume.volume_id\": \"7a649d14-618d-4dd2-8e21-06e34792d439\", \"TendrlContext.integration_id\": \"9f02935f-52c1-4edf-bafd-a94d055943f8\"}, \"tags\": [\"provisioner/9f02935f-52c1-4edf-bafd-a94d055943f8\"], \"created_at\": \"2018-03-17T10:54:22Z\", \"created_from\": \"API\", \"type\": \"sds\", \"name\": \"StartProfiling\"}", "modifiedIndex": 45430, "createdIndex": 45430 }, { "key": "/queue/68743694-d32d-49a4-ae50-a693dfdbe6f6/job_id", "value": "68743694-d32d-49a4-ae50-a693dfdbe6f6", "modifiedIndex": 45424, "createdIndex": 45424 }, { "key": "/queue/68743694-d32d-49a4-ae50-a693dfdbe6f6/updated_at", "value": "2018-03-17 10:54:25.031482+00:00", "modifiedIndex": 45428, "createdIndex": 45428 }, { "key": "/queue/68743694-d32d-49a4-ae50-a693dfdbe6f6/timeout", "value": "yes", "modifiedIndex": 45445, "createdIndex": 45445 }, { "key": "/queue/68743694-d32d-49a4-ae50-a693dfdbe6f6/children", "value": "", "modifiedIndex": 45446, "createdIndex": 45446 } ], "modifiedIndex": 45196, "createdIndex": 45196 } }

Volume flag:

{ "key": "/clusters/9f02935f-52c1-4edf-bafd-a94d055943f8/Volumes/7a649d14-618d-4dd2-8e21-06e34792d439/profiling_enabled", "value": "", "modifiedIndex": 88759, "createdIndex": 88759 },

nthomas-redhat commented 6 years ago

Same behavior is seen even when you try to update the volume wise profiling status after the import

shtripat commented 6 years ago

backend side the parameter required for volume profiling enable/disable is Volume.vol_id and not Volume.volume_id. Thats the reason its failing. We need to fix the same in API layer.