LXDAPIException: json: cannot unmarshal bool into Go value of type string when using config-drive
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu Cloud Archive |
Fix Released
|
Undecided
|
Unassigned | ||
Newton |
Fix Released
|
Undecided
|
Unassigned | ||
Ocata |
Fix Released
|
Undecided
|
Unassigned | ||
Pike |
Fix Released
|
Undecided
|
Unassigned | ||
nova-lxd |
Fix Released
|
Undecided
|
Unassigned | ||
nova-lxd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Yakkety |
Fix Released
|
Undecided
|
Unassigned | ||
Zesty |
Fix Released
|
Undecided
|
Unassigned | ||
Artful |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
Not possible to use the config-drive support (as currently in yakkety-proposed, zesty and artful)
[Test Case]
Deploy Nova-LXD based OpenStack Cloud
openstack server create --wait --image xenial --flavor m1.small --key-name testkey --nic net-id=XXXX --min 1 --max 1 --config-drive True xenial-config-drive
instance will go into ERROR state and fail to boot.
[Regression Potential]
Minimal; this feature has never worked correctly, the fix resolves and issue with passing the readonly flag for the config-drive device as a boolean rather than a string (as required by the LXD API).
[Original Bug Report]
When booting instances using the --config-drive flag, the instance fail to boot with the following error:
LXDAPIException: json: cannot unmarshal bool into Go value of type string
nova-lxd is passing the 'readonly' flag as a boolean, not as a string, and the LXD API fails to unmarshall it as a result.
description: | updated |
Reviewed: https:/ /review. openstack. org/465482 /git.openstack. org/cgit/ openstack/ nova-lxd/ commit/ ?id=95e1db84bc7 c9bb83ca3081d61 3b013427b7ed56
Committed: https:/
Submitter: Jenkins
Branch: master
commit 95e1db84bc7c9bb 83ca3081d613b01 3427b7ed56
Author: James Page <email address hidden>
Date: Wed May 17 10:43:40 2017 +0100
Pass readonly flag as a string, not a boolean.
The LXD API requires that data be passed as strings; pass the
readonly flag for config-drive support as a string to ensure
it can be parsed by LXD avoiding the following error:
json: cannot unmarshal bool into Go value of type string
Change-Id: I0c5dbd9cb8b8ea 4f43398849f8b4c 33305231d54
Closes-Bug: 1691428