edf-hpc / clara

Cluster Administration tools
Other
18 stars 12 forks source link

Add a virt plugin #75

Closed hmlth closed 8 years ago

hmlth commented 8 years ago

Manages VMs used in a cluster.

The plugin uses a small lib that talks to multiple libvirt connections. Its integrated in clara.virt, the tool was standalone initially.

There is a specific config file (/etc/clara/virt.ini) for configuring pools, host groups and template. Some more generic parameters might be added in the main config eventually, but none in this initial code.

Code is not compatible with squeeze but fails with a clear error message.

Usage:
    clara virt list [--virt-config=<path>]
    clara virt define <vm_names> --host=<host> [--template=<template_name>] [--virt-config=<path>]
    clara virt undefine <vm_names> [--host=<host>] [--virt-config=<path>]
    clara virt start <vm_names> [--host=<host>] [--wipe] [--virt-config=<path>]
    clara virt stop <vm_names> [--host=<host>] [--hard] [--virt-config=<path>]
    clara virt migrate <vm_names> --dest-host=<dest_host> [--host=<host>] [--virt-config=<path>]
    clara virt -h | --help | help

Options:
    vm_names                    List of VM names
    <host>                      Physical host where the action should be applied
    --wipe                      Wipe the content of the storage volume before starting
    --hard                      Perform a hard shutdown
    --dest-host=<dest_host>     Destination host of a migration
    --template=<template_name>  Use this template instead of the in config
    --virt-config=<path>        Path of the virt config file [default: /etc/clara/virt.ini]
ana commented 8 years ago

I consolidated the commits, remove some trailing spaces, update the headers and merged it. Thanks! :)