xo-cli vm.create from bash fails
-
I'm trying to piece together a way to deploy VMs using xo-cli. Ansible seems like a sensible choice, but at the moment I'm just trying the basics from shell. Listing object is working fine, but I can't seem to get creating a VM to work.
This works:
npx xo-cli --list-objects type=VM-template uuid=d986ea98-09fa-4e9a-9ee6-e6c78119496f
But this fails:
npx xo-cli vm.create name_label="test" name_description="dsc" template=d986ea98-09fa-4e9a-9ee6-e6c78119496f bootaftercreate=false VIFs="json:[{\"network\":\"$NETUUID\"}]"
with error:
✖ no such VM-template d986ea98-09fa-4e9a-9ee6-e6c78119496f JsonRpcError: no such VM-template d986ea98-09fa-4e9a-9ee6-e6c78119496f
This might be related to me doing stuff in bash, but escaping the dashes or adding quotes around the string does not help.
Any ideas?
-
Solved: you need to use the template id, not the uuid.