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

    Clarification on Creating ResourceSet via xo-cli

    Scheduled Pinned Locked Moved REST API
    4 Posts 3 Posters 147 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.
    • S Offline
      samuelolavo
      last edited by

      Hi,

      I am trying to create a resource set using the xo-cli command with the following syntax:

      xo-cli resourceSet.create name='test' subjects='["123"]' objects='["123", "456"]' limits='{"ram":"16","disk":"200","cpu":"8"}' tags='["3321"]' networks='["321"]' shareByDefault=true
      

      Could you please confirm if this is the correct way to create a resource set in Xen Orchestra, or if any adjustments are required to ensure successful execution?

      Thank you for your assistance!

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

        Ping @julien-f

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          samuelolavo @olivierlambert
          last edited by

          @julien-f

          Hello,

          When I try to create a:

          resourceSet.create name=test-resource subjects=["d301d9ea-9e22-4480-bf40-111111111111"]' objects='["8fb06362-d8fe-598b-f819-11111111111111"]' shareByDefault=1
          

          I always get this error:

          ✖ invalid parameters
            property @./subjects: must be array
            property @./objects: must be array
          

          Also, I don't know how to specify the resource limits.

          If you can help me, I would greatly appreciate it!

          Thank you very much!

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

            @samuelolavo Shell only handles string values, to pass other types to xo-cli you need to encode them in JSON and use the json: prefix:

            xo-cli resourceSet.create name=test-resource subjects=json:'["d301d9ea-9e22-4480-bf40-111111111111"]' objects=json:'["8fb06362-d8fe-598b-f819-11111111111111"]' shareByDefault=json:true
            
            1 Reply Last reply Reply Quote 1
            • First post
              Last post