[Kimchi-devel] [PATCH]Ginger Base:Take off libvirt to get vms info used before any shutdown and reboot actions

Aline Manera alinefm at linux.vnet.ibm.com
Tue Nov 3 17:29:19 UTC 2015


I agree with the idea of this patch but I don't think we need a new API 
for that.
It should be a validation step of the shutdown/reboot actions that 
should return the right error message when a vm is running.

For example:

POST /plugins/gingerbase/host/shutdown

would return InvalidOperation("There are running vms in the host")

On 03/11/2015 04:45, chandra at linux.vnet.ibm.com wrote:
> From: chandrureddy <chandra at linux.vnet.ibm.com>
>
> Earlier been used libvirt to fetch the vms information in the back end code
> UI was using REST API 'plugins/kimchi/vms' to get the vms info.
> Ginger Base not have this functionality and will not work on plain linux.
> Ginger Base should handle well on both plain linux with out KVM and with KVM
>      
> New code provides REST API 'plugins/gingerbase/vms'
> 1. to get the vms information on KVM mahcine (virsh way)
> For ex:
> [root at chandra wok]# curl -k -u root -H "Content-Type: application/json" -H "Accept: application/json" \
> -X "GET" https://127.0.0.1:8001/plugins/gingerbase/vms
> Enter host password for user 'root':
> [
>    {
>      "state":"shut off",
>      "id":"-",
>      "name":"a8Sr0LzRgWjEqy3iiKjQvA"
>    },
>    {
>      "state":"shut off",
>      "id":"-",
>      "name":"Fedora21"
>    },
>    {
>      "state":"shut off",
>      "id":"-",
>      "name":"kimchi-cdrom"
>    },
>    {
>      "state":"shut off",
>      "id":"-",
>      "name":"kimchi-ifaces"
>    }
> ]
>
> 2. return empty json in case of plain linux machine
> For ex:
> [root at chandra wok]# curl -k -u root -H "Content-Type: application/json" -H "Accept: application/json" \
> -X "GET" https://127.0.0.1:8001/plugins/gingerbase/vms
> Enter host password for user 'root':
> [
> ]
>
> chandrureddy (1):
>    Take off libvirt to get vms info used before any shutdown and reboot
>      actions
>
>   src/wok/plugins/gingerbase/control/vmsinfo.py      | 34 +++++++++++++
>   src/wok/plugins/gingerbase/i18n.py                 |  1 +
>   src/wok/plugins/gingerbase/model/host.py           | 23 +++------
>   src/wok/plugins/gingerbase/model/vmsinfo.py        | 32 ++++++++++++
>   .../plugins/gingerbase/ui/js/src/gingerbase.api.js | 12 +++++
>   .../gingerbase/ui/js/src/gingerbase.host.js        | 23 ++++-----
>   src/wok/plugins/gingerbase/ui/pages/i18n.json.tmpl |  2 +
>   src/wok/plugins/gingerbase/utils.py                | 59 +++++++++++++++++++++-
>   8 files changed, 157 insertions(+), 29 deletions(-)
>   create mode 100644 src/wok/plugins/gingerbase/control/vmsinfo.py
>   create mode 100644 src/wok/plugins/gingerbase/model/vmsinfo.py
>




More information about the Kimchi-devel mailing list