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

    xo-cli help

    Scheduled Pinned Locked Moved Xen Orchestra
    10 Posts 4 Posters 2.7k Views 1 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.
    • kirovtomeK Offline
      kirovtome
      last edited by

      Hi, i was messing around xo-cli and I'm kinda stuck with these ones:

      1. xo-cli vm.create CPUs=1 deploys CPU limits: 1/2. How can i achieve something like CPU limits 2/4 ?
      2. 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.
      3. 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)
      4. How can i disable fast_clone checkbox?

      Appreciate your help

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

        Ping @julien-f

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

          1. @badrAZ Do you have the answer to this one?
          2. Use memoryMin & memoryMax
          3. To alter disks inherited from the template, you must use existingDisks=json:'{"0": { "name_label": "New name", "$SR": "ddb10e9b-31a4-0354-8816-d3fd992f7fcb" } }'
            Where 0 is the device of the existing disks (in fact the VBD between the VDI and the VM template).
          4. clone=json:false
          kirovtomeK 1 Reply Last reply Reply Quote 1
          • badrAZB Offline
            badrAZ
            last edited by badrAZ

            Hi,

            For the first question, you can use cpusMax to set the CPUs limit. xo-cli vm.create cpus=2 cpusMax=4

            1 Reply Last reply Reply Quote 1
            • kirovtomeK Offline
              kirovtome @julien-f
              last edited by

              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!

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

                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 with json::

                xo-cli vm.set id=<some_id> CPUs=json:4
                
                kirovtomeK 1 Reply Last reply Reply Quote 1
                • kirovtomeK Offline
                  kirovtome @julien-f
                  last edited by

                  @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 using vm.set. It says invalid parameter property @: should not contains property ["existingDisks"].

                  @olivierlambert you can close this one tho. Many thanks!

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

                    @kirovtome Indeed, this param only applies to vm.create, not vm.set.

                    kirovtomeK 1 Reply Last reply Reply Quote 1
                    • kirovtomeK Offline
                      kirovtome @julien-f
                      last edited by

                      @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?

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

                        @kirovtome

                        > xo-cli --list-commands vdi.set
                        vdi.set id=<string> [name_label=<string>] [name_description=<string>] [size=<integer|string>]
                        
                        1 Reply Last reply Reply Quote 1
                        • B Byte0 referenced this topic on

                        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