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

    xo-cli vm.create from bash fails

    Scheduled Pinned Locked Moved Xen Orchestra
    2 Posts 1 Posters 373 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.
    • L Offline
      lefty
      last edited by

      I'm trying to piece together a way to deploy VMs using xo-cli. Ansible seems like a sensible choice, but at the moment I'm just trying the basics from shell. Listing object is working fine, but I can't seem to get creating a VM to work.

      This works:
      npx xo-cli --list-objects type=VM-template uuid=d986ea98-09fa-4e9a-9ee6-e6c78119496f

      But this fails:
      npx xo-cli vm.create name_label="test" name_description="dsc" template=d986ea98-09fa-4e9a-9ee6-e6c78119496f bootaftercreate=false VIFs="json:[{\"network\":\"$NETUUID\"}]"
      with error:
      ✖ no such VM-template d986ea98-09fa-4e9a-9ee6-e6c78119496f JsonRpcError: no such VM-template d986ea98-09fa-4e9a-9ee6-e6c78119496f

      This might be related to me doing stuff in bash, but escaping the dashes or adding quotes around the string does not help.

      Any ideas?

      1 Reply Last reply Reply Quote 0
      • L Offline
        lefty
        last edited by

        Solved: you need to use the template id, not the uuid.

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