OpenNebula has a command line toolchest called onevm
, which is written in Ruby. This repository contains a naïve Dockerfile which creates a container (either Docker or Podman) with the toolchest.
# This is using docker
docker build -t onetools:5.8.5 .
# This is using podman
podman build -t onetools:5.8.5 .
docker run --rm -ti onetools:5.8.5 onevm list --verbose --endpoint http://yourONEfrontend:2633/RPC2 --user yourONEuser --password yourONEpass
podman run --rm -ti onetools:5.8.5 onevm list --verbose --endpoint http://yourONEfrontend:2633/RPC2 --user yourONEuser --password yourONEpass
You can find more information about onetools here and the honored environment variables.
Sometimes you can need to filter by a custom property which is only included in the XML format. So, the container also contains the xpath command.
docker run --rm -ti onetools:5.8.5
onevm list --xml --no-pager http://yourONEfrontend:2633/RPC2 --user yourONEuser --password yourONEpass | xpath -q -e '//VM[./USER_TEMPLATE/LABELS[contains(. , 'customLabel')]]/ID/text()'