Change VM attribute "name" (NOT "name-label")
-
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.
-
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). -
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>
-
Well, then the script isn't right: it must use XAPI to do whatever it needs, usage of xl is dangerous.
-
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.
-
Don't worry, glad you asked to avoid having bigger problems later
edit: there's a Python SDK for XAPI if you need.