xo-cli help
-
Hi, i was messing around xo-cli and I'm kinda stuck with these ones:
- xo-cli vm.create CPUs=1 deploys CPU limits: 1/2. How can i achieve something like CPU limits 2/4 ?
- The same goes with memory. How can i configure min/max static and dynamic memory. I've tried with memory='json:[{"dynamic": [1073741824, 4294967296]}]' but no luck.
- How can i update the SR size/name when deploying from template using custom config? (i'm using the CentOS 8 Cloudinit ready template from XO Hub)
- How can i disable fast_clone checkbox?
Appreciate your help
-
Ping @julien-f
-
- @badrAZ Do you have the answer to this one?
- Use
memoryMin
&memoryMax
- To alter disks inherited from the template, you must use
existingDisks=json:'{"0": { "name_label": "New name", "$SR": "ddb10e9b-31a4-0354-8816-d3fd992f7fcb" } }'
Where0
is the device of the existing disks (in fact the VBD between the VDI and the VM template). clone=json:false
-
Hi,
For the first question, you can use
cpusMax
to set the CPUs limit.xo-cli vm.create cpus=2 cpusMax=4
-
Thanks a lot guys! @julien-f could you provide me an example with memoryMin and memoryMax cuz when I try to run this command:
xo-cli vm.create template="118d4978-a9f9-ec99-52e3-df5e78b004a2" name_label="vmnew1" cloudConfig="centos8-cc" VIFs='json:[{"network":"40f00688-388d-997e-7f1c-12bbdf6134f8"}]' bootAfterCreate=true memoryMin=1073741824 memoryMax=1073741824
the output is:
✖ unknown error from the peer JsonRpcError: unknown error from the peer at Peer._callee$ (/usr/local/lib/node_modules/xo-cli/node_modules/json-rpc-peer/dist/index.js:212:17) ..and so on
This works tho if i specify memoryMin or memoryMax only (not both). Also, do these memoryMin and memoryMax refer to the static or dynamic memory? I'm kinda newbie on this one.
@badrAZ after the deployment, when i try to set the cpu, for example:
xo-cli vm.set id=<some_id> CPUs=4
i got this error:
✖ invalid parameters property @.CPUs: must be integer, but is string
If you know anything about this, please let me know.
Thanks! -
It's not obvious but when you get
unknown error from the peer
you can go to the Settings/Logs of the web UI to have a detailed error.Also, for non-string values, like
CPUs
, you need to prefix withjson:
:xo-cli vm.set id=<some_id> CPUs=json:4
-
@julien-f Thanks a lot man! One more thing tho. It seems that i can't use
existingDisks
when i try to upgrade the VM disk size usingvm.set
. It saysinvalid parameter property @: should not contains property ["existingDisks"]
.@olivierlambert you can close this one tho. Many thanks!
-
@kirovtome Indeed, this param only applies to
vm.create
, notvm.set
. -
@julien-f and what if i want to update the disk size. Is there any parameter that i can use with
vm.set
or is it another command? -
> xo-cli --list-commands vdi.set vdi.set id=<string> [name_label=<string>] [name_description=<string>] [size=<integer|string>]