XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Location of xo-cli reference

    Scheduled Pinned Locked Moved Management
    6 Posts 3 Posters 141 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B Offline
      Byte0
      last edited by

      Is there an online reference for xo-cli with examples? I can't find it. I know that xo-cli has help output, but it isn't detailed enough for me to understand fully how to use it.

      Here's my specific example:

      xo-cli vm.set auto_poweron=true id="f329c1f2-424e-1451-7c61-fee57273e6c4" CPUs=8 memory=17179869184 secureBoot=false
      āœ– invalid parameters
        property @./CPUs: must be integer
      

      After I create the VM with xo-cli vm.create, I am trying to set the number of CPUs to 8 and the RAM to 16GB.

      B 1 Reply Last reply Reply Quote 0
      • B Offline
        Byte0 @Byte0
        last edited by

        Also more details regarding how vm.createCloudInitConfigDrive works would be good.

        The help information from xo-cli list-commands has the following

        vm.createCloudInitConfigDrive vm=<string> sr=<string> config=<string> [networkConfig=<string>]

        Is the string for config and networkConfig supposed to be the id of objects created using cloudConfig.create?

        Does the template= parameter for cloudConfig.create accept the yaml string for cloud-init?

        1 Reply Last reply Reply Quote 0
        • olivierlambertO Online
          olivierlambert Vates 🪐 Co-Founder CEO
          last edited by

          Ping @Butcat

          B 1 Reply Last reply Reply Quote 0
          • B Offline
            Byte0 @olivierlambert
            last edited by

            @olivierlambert I stumbled across this here while searching for something else: https://xcp-ng.org/forum/topic/3671/xo-cli-help/5

            I need to specify "json:8" to set the CPUs to 8. I did see the use of the "json:" prefix here (https://docs.xen-orchestra.com/architecture#xo-cli-cli), but the example shows using that prefix for a list rather than a single value. Not to mention that when setting the memory with vm.set, using "json:" is not required, so I didn't think to try that. I figured it out eventually though.

            julien-fJ 1 Reply Last reply Reply Quote 0
            • olivierlambertO Online
              olivierlambert Vates 🪐 Co-Founder CEO
              last edited by

              Pinging @julien-f maybe šŸ˜„

              1 Reply Last reply Reply Quote 0
              • julien-fJ Offline
                julien-f Vates 🪐 Co-Founder XO Team @Byte0
                last edited by

                @Byte0 The json: makes the rest of the value interpreted as JSON, otherwise it is interpreted as a plain string. It is therefore required for all non-string values.

                Some method params (like memory for vm.set) accept both integers and strings, that's why it was working.

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post