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

    Location of xo-cli reference

    Scheduled Pinned Locked Moved Management
    6 Posts 3 Posters 819 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 Offline
          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 Offline
              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

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better šŸ’—

                Register Login
                • First post
                  Last post