According to the
RAPI docs:
disks
(defaults to []
, must be (List of ((Length 3) and (Item 0 is (OneOf attach, detach, add, modify, remove), item 1 is (Integer or String [Device index, can be negative, e.g. -1 for last disk]), item 2 is (Dictionary with keys of NonEmptyString and values of (NonEmptyString or Integer) [Disk parameters]))) [Recommended]) or (List of ((Length 2) and (Item 0 is ((OneOf attach, detach, add, remove) or EqualOrGreaterThanZero), item 1 is (Dictionary with keys of NonEmptyString and values of (NonEmptyString or Integer) [Disk parameters]))) [Deprecated])
)
I tried different types of disks payload with no success:
{'disks': ['add', 1, [{'size': '10G'}]]}
{'disks': ['add', 1, {'size': '10G'}]}
even with the deprecated type:
{'disks': ['add', {'size': '10G'}]}
I always get the same error depending on the payload:
ganeti-rapi pid=641664 ERROR OpCode OP_INSTANCE_SET_PARAMS, parameter disks, has invalid type <class 'list'>/value '['add', 1, [{'size': '10G'}]]' expecting type (List of ((Length 3) and (Item 0 is (OneOf detach, attach, modify, remove, add), item 1 is (Integer or String [Device index, can be negative, e.g. -1 for last disk]), item 2 is (Dictionary with keys of NonEmptyString and values of (NonEmptyString or Integer) [Disk parameters]))) [Recommended]) or (List of ((Length 2) and (Item 0 is ((OneOf attach, detach, add, remove) or EqualOrGreaterThanZero), item 1 is (Dictionary with keys of NonEmptyString and values of (NonEmptyString or Integer) [Disk parameters]))) [Deprecated])
It would be great if someone could direct me to how to create the payload for RAPI for:
gnt-instance modify --disks/--nicks add/remove