Commit b3c5e8de authored by Iustin Pop's avatar Iustin Pop
Browse files

htools: read the disk_template in the Luxi backend



We need to request the disk template in the Luxi query and then use it
when parsing the response.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 5a4a3b7f
......@@ -77,7 +77,7 @@ queryInstancesMsg :: L.LuxiOp
queryInstancesMsg =
L.QueryInstances [] ["name", "disk_usage", "be/memory", "be/vcpus",
"status", "pnode", "snodes", "tags", "oper_ram",
"be/auto_balance"] False
"be/auto_balance", "disk_template"] False
-- | The input data for cluster query.
queryClusterInfoMsg :: L.LuxiOp
......@@ -115,7 +115,7 @@ parseInstance :: NameAssoc
-> Result (String, Instance.Instance)
parseInstance ktn (JSArray [ name, disk, mem, vcpus
, status, pnode, snodes, tags, oram
, auto_balance ]) = do
, auto_balance, disk_template ]) = do
xname <- annotateResult "Parsing new instance" (fromJVal name)
let convert a = genericConvert "Instance" xname a
xdisk <- convert "disk_usage" disk
......@@ -130,8 +130,9 @@ parseInstance ktn (JSArray [ name, disk, mem, vcpus
xrunning <- convert "status" status
xtags <- convert "tags" tags
xauto_balance <- convert "auto_balance" auto_balance
xdt <- convert "disk_template" disk_template
let inst = Instance.create xname xmem xdisk xvcpus
xrunning xtags xauto_balance xpnode snode DTDrbd8
xrunning xtags xauto_balance xpnode snode xdt
return (xname, inst)
parseInstance _ v = fail ("Invalid instance query result: " ++ show v)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment