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 581 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

        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