Onevm command from KVM nodes

I used to Minione for evaluating OpenNebula, and developed a script to customize VM deployment. Specifically, this script uses onevm show command to get VM info.

In Minione, it works fine, since everything is on single host. However, when I deployed it to a cluster where KVM node is in separate host, I realized that onevm command is not available in it.

So, my question is, is there a way to use onvm command from a KVM node?

To add some context, the script uses onevm show to extract certain user tag from VM definition. It then modifies libvirt domain XML file by adding some addition info. Is there some other way to get a list of VM tags? I didn’t notice that they are present in domain XML.

Hello @vdjurovic,

So, my question is, is there a way to use onvm command from a KVM node?

OpenNebula CLI commands are only available in the front-ends, not in the nodes.

To add some context, the script uses onevm show to extract certain user tag from VM definition. It then modifies libvirt domain XML file by adding some addition info. Is there some other way to get a list of VM tags?

You can achieve this by using hooks to connect via SSH to the hypervisor. Also check this, it might be helpful.

Best,
Álex.

The RAW section could have static strings only. From years I am using an alternative deployment script. You could extract the deploy-tweaks part of addon-storpool. There is some information for the implemented helpers.

Cheers,
Anton Todorov

1 Like

Thanks for the help, guys

@atodorov_storpool I took a look at deployment-tweaks that you mentioned, and there is this line.

onevm show "$VM_ID" -x >"$VM_XML" 2>"$ERR_FILE"

I use the same command in my script, but as I said, it does not work on node. Do you run this script only on front end?

Yes.
The deploy action is defined as a local in the VM_MAD definition:

    NAME           = "kvm",
    SUNSTONE_NAME  = "KVM",
    EXECUTABLE     = "one_vmm_exec",
    ARGUMENTS      = "-t 15 -r 0 kvm -l deploy=deploy-tweaks",
    ...

Best Regards,
Anton Todorov