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

    Change VM attribute "name" (NOT "name-label")

    Scheduled Pinned Locked Moved Compute
    6 Posts 2 Posters 71 Views 2 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.
    • R Offline
      randyrue
      last edited by

      I'm trying to change the "name" attribute of a VM that's returned by the "xl vm-list" command. This is not the same as the "name-label" attribute returned by "xe vm-list" and shown in XOA. No sign of any such attribute in the auto completion for the xe vm-param-set command.

      I could clone the VM to the correct name but that feels like overkill.

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

        Hi,

        It's simple: you shouldn't use xl to manage your VMs, never. It's another API (libxl) and this might create a lot of troubles because it's not sync with XAPI (the API used in XCP-ng).

        1 Reply Last reply Reply Quote 0
        • R Offline
          randyrue
          last edited by

          In this case I'm only using it to return VM info for an export script. The script takes the VM name as an argument and then walks the hosts and vm lists looking for it. But the VM was cloned and has a "name" of <name-label><snapshot_stamp><_COPY>

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

            Well, then the script isn't right: it must use XAPI to do whatever it needs, usage of xl is dangerous.

            1 Reply Last reply Reply Quote 0
            • R Offline
              randyrue
              last edited by

              After reading up on xl you're not wrong. I'll fix the script and firmly chastise the guy that wrote it (in the mirror). I think I went with xl because it was easier to split the results in python.

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

                Don't worry, glad you asked to avoid having bigger problems later 🙂

                edit: there's a Python SDK for XAPI if you need.

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