Bug 1324923 - [RFE] hosted-engine --vm-status should be able to output the raw response
Summary: [RFE] hosted-engine --vm-status should be able to output the raw response
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-hosted-engine-setup
Classification: oVirt
Component: RFEs
Version: 2.0.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ovirt-4.0.0-rc
: 2.0.0.1
Assignee: Simone Tiraboschi
QA Contact: Nikolai Sednev
URL:
Whiteboard:
Depends On: 1344900
Blocks: ovirt-node-ng 1318415
TreeView+ depends on / blocked
 
Reported: 2016-04-07 15:13 UTC by Ryan Barry
Modified: 2017-05-11 09:25 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
With this release, "hosted-engine --vm-status" can output the raw JSON response by appending "--json" to the command.
Clone Of:
Environment:
Last Closed: 2016-07-05 07:44:54 UTC
oVirt Team: Integration
Embargoed:
rule-engine: ovirt-4.0.0+
rule-engine: exception+
mavital: testing_plan_complete+
ylavi: planning_ack+
sbonazzo: devel_ack+
nsednev: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 56721 0 master MERGED Add --json to --vm-status 2016-05-30 17:19:24 UTC

Description Ryan Barry 2016-04-07 15:13:45 UTC
Description of problem:
For parsing by other utilities (which do not use python), hosted-engine --vm-status should take a flag to output the raw JSON response from HAClient.

Comment 1 Red Hat Bugzilla Rules Engine 2016-04-07 15:13:51 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 2 Fabian Deutsch 2016-04-26 13:31:32 UTC
Any ETA for this RFE? The Cockpit implementation depends on this RFE.

Comment 3 Nikolai Sednev 2016-04-26 13:37:22 UTC
Can you kindly provide verification and reproduction steps?

Comment 4 Simone Tiraboschi 2016-04-26 14:52:17 UTC
Probably just running 
 hosted-engine --vm-status --json
or an option with a similar name but we still have to implement it.

Comment 5 Ryan Barry 2016-04-26 19:43:54 UTC
(In reply to Nikolai Sednev from comment #3)
> Can you kindly provide verification and reproduction steps?

Basically a way to output the raw status which HAClient gets anyway, in a format which is easily machine-readable. I'll try to provide a patch today or tomorrow.

Comment 6 Sandro Bonazzola 2016-04-27 13:21:26 UTC
Ryan, do you have time for providing a patch?

Comment 7 Ryan Barry 2016-04-27 14:19:46 UTC
(In reply to Sandro Bonazzola from comment #6)
> Ryan, do you have time for providing a patch?

I do have time to provide a patch today

Comment 8 Sandro Bonazzola 2016-05-02 09:52:11 UTC
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.

Comment 11 Nikolai Sednev 2016-06-14 13:15:06 UTC
On latest componets I could see these:
# hosted-engine --help
 --vm-status [--json]
            VM status according to the HA agent. If --json is given, the
            output will be in machine-readable (JSON) format

Before deployment:
# hosted-engine --vm-status without --json
You must run deploy first

But the whole HE deployment had failed because of the 1344900 and I could not proceed with verification of this bug as dependent.

Comment 12 Nikolai Sednev 2016-06-16 12:54:10 UTC
[root@alma04 ~]# hosted-engine --vm-status without --json


--== Host 1 status ==--

Status up-to-date                  : False
Hostname                           : alma03.qa.lab.tlv.redhat.com
Host ID                            : 1
Engine status                      : unknown stale-data
Score                              : 0
stopped                            : False
Local maintenance                  : True
crc32                              : 6e6c1bcd
Host timestamp                     : 70655
Extra metadata (valid at timestamp):
        metadata_parse_version=1
        metadata_feature_version=1
        timestamp=70655 (Thu Jun  9 11:52:48 2016)
        host-id=1
        score=0
        maintenance=True
        state=LocalMaintenance
        stopped=False


--== Host 2 status ==--

Status up-to-date                  : False
Hostname                           : alma04.qa.lab.tlv.redhat.com
Host ID                            : 2
Engine status                      : unknown stale-data
Score                              : 0
stopped                            : True
Local maintenance                  : False
crc32                              : d478ed7d
Host timestamp                     : 100764
Extra metadata (valid at timestamp):
        metadata_parse_version=1
        metadata_feature_version=1
        timestamp=100764 (Wed Jun 15 20:50:43 2016)
        host-id=2
        score=0
        maintenance=False
        state=AgentStopped
        stopped=True
[root@alma04 ~]# hosted-engine --vm-status --json
{"1": {"live-data": false, "extra": "metadata_parse_version=1\nmetadata_feature_version=1\ntimestamp=70655 (Thu Jun  9 11:52:48 2016)\nhost-id=1\nscore=0\nmaintenance=True\nstate=LocalMaintenance\nstopped=False\n", "hostname": "alma03.qa.lab.tlv.redhat.com", "host-id": 1, "engine-status": {"reason": "vm not running on this host", "health": "bad", "vm": "down", "detail": "unknown"}, "score": 0, "stopped": false, "maintenance": true, "crc32": "6e6c1bcd", "host-ts": 70655}, "2": {"live-data": false, "extra": "metadata_parse_version=1\nmetadata_feature_version=1\ntimestamp=100764 (Wed Jun 15 20:50:43 2016)\nhost-id=2\nscore=0\nmaintenance=False\nstate=AgentStopped\nstopped=True\n", "hostname": "alma04.qa.lab.tlv.redhat.com", "host-id": 2, "engine-status": {"health": "good", "vm": "up", "detail": "up"}, "score": 0, "stopped": true, "maintenance": false, "crc32": "d478ed7d", "host-ts": 100764}}
[root@alma04 ~]# hosted-engine --vm-status 


--== Host 1 status ==--

Status up-to-date                  : False
Hostname                           : alma03.qa.lab.tlv.redhat.com
Host ID                            : 1
Engine status                      : unknown stale-data
Score                              : 0
stopped                            : False
Local maintenance                  : True
crc32                              : 6e6c1bcd
Host timestamp                     : 70655
Extra metadata (valid at timestamp):
        metadata_parse_version=1
        metadata_feature_version=1
        timestamp=70655 (Thu Jun  9 11:52:48 2016)
        host-id=1
        score=0
        maintenance=True
        state=LocalMaintenance
        stopped=False


--== Host 2 status ==--

Status up-to-date                  : False
Hostname                           : alma04.qa.lab.tlv.redhat.com
Host ID                            : 2
Engine status                      : unknown stale-data
Score                              : 0
stopped                            : True
Local maintenance                  : False
crc32                              : d478ed7d
Host timestamp                     : 100764
Extra metadata (valid at timestamp):
        metadata_parse_version=1
        metadata_feature_version=1
        timestamp=100764 (Wed Jun 15 20:50:43 2016)
        host-id=2
        score=0
        maintenance=False
        state=AgentStopped
        stopped=True

Works for me on these components on host:
mom-0.5.4-1.el7ev.noarch
ovirt-vmconsole-1.0.3-1.el7ev.noarch
sanlock-3.2.4-2.el7_2.x86_64
libvirt-client-1.2.17-13.el7_2.5.x86_64
qemu-kvm-rhev-2.3.0-31.el7_2.15.x86_64
vdsm-4.18.1-11.gita92976e.el7ev.x86_64
ovirt-hosted-engine-setup-2.0.0-1.el7ev.noarch
ovirt-host-deploy-1.5.0-1.el7ev.noarch
ovirt-hosted-engine-ha-2.0.0-1.el7ev.noarch
ovirt-setup-lib-1.0.2-1.el7ev.noarch
ovirt-vmconsole-host-1.0.3-1.el7ev.noarch
ovirt-engine-sdk-python-3.6.5.0-1.el7ev.noarch
Linux version 3.10.0-327.22.2.el7.x86_64 (mockbuild.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) ) #1 SMP Thu Jun 9 10:09:10 EDT 2016
Linux 3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 9 10:09:10 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
Red Hat Enterprise Linux Server release 7.2 (Maipo)

Engine:
ovirt-engine-setup-plugin-ovirt-engine-4.0.0.2-0.1.el7ev.noarch
ovirt-vmconsole-1.0.3-1.el7ev.noarch
ovirt-engine-extension-aaa-jdbc-1.1.0-1.el7ev.noarch
rhevm-4.0.0.2-0.1.el7ev.noarch
ovirt-engine-setup-base-4.0.0.2-0.1.el7ev.noarch
ovirt-engine-websocket-proxy-4.0.0.2-0.1.el7ev.noarch
ovirt-image-uploader-4.0.0-1.el7ev.noarch
ovirt-engine-backend-4.0.0.2-0.1.el7ev.noarch
ovirt-engine-tools-4.0.0.2-0.1.el7ev.noarch
rhevm-guest-agent-common-1.0.12-1.el7ev.noarch
ovirt-engine-lib-4.0.0.2-0.1.el7ev.noarch
ovirt-engine-dwh-setup-4.0.0-2.el7ev.noarch
ovirt-log-collector-4.0.0-1.el7ev.noarch
rhevm-branding-rhev-4.0.0-0.0.master.20160531161414.el7ev.noarch
ovirt-engine-vmconsole-proxy-helper-4.0.0.2-0.1.el7ev.noarch
ovirt-host-deploy-java-1.5.0-1.el7ev.noarch
ovirt-engine-dbscripts-4.0.0.2-0.1.el7ev.noarch
ovirt-engine-4.0.0.2-0.1.el7ev.noarch
rhev-guest-tools-iso-4.0-2.el7ev.noarch
ovirt-engine-setup-plugin-websocket-proxy-4.0.0.2-0.1.el7ev.noarch
ovirt-engine-tools-backup-4.0.0.2-0.1.el7ev.noarch
ovirt-engine-userportal-4.0.0.2-0.1.el7ev.noarch
rhev-release-4.0.0-12-001.noarch
ovirt-engine-setup-4.0.0.2-0.1.el7ev.noarch
ovirt-vmconsole-proxy-1.0.3-1.el7ev.noarch
rhevm-dependencies-4.0.0-1.el7ev.noarch
ovirt-engine-restapi-4.0.0.2-0.1.el7ev.noarch                                                                                                     
rhevm-setup-plugins-4.0.0-1.el7ev.noarch
ovirt-engine-cli-3.6.2.0-1.el7ev.noarch
rhevm-doc-4.0.0-2.el7ev.noarch
ovirt-engine-setup-plugin-ovirt-engine-common-4.0.0.2-0.1.el7ev.noarch
ovirt-engine-extensions-api-impl-4.0.0.2-0.1.el7ev.noarch
ovirt-iso-uploader-4.0.0-1.el7ev.noarch
ovirt-engine-webadmin-portal-4.0.0.2-0.1.el7ev.noarch
ovirt-engine-dwh-4.0.0-2.el7ev.noarch
ovirt-engine-setup-plugin-vmconsole-proxy-helper-4.0.0.2-0.1.el7ev.noarch
ovirt-host-deploy-1.5.0-1.el7ev.noarch
ovirt-setup-lib-1.0.2-1.el7ev.noarch
ovirt-engine-sdk-python-3.6.5.0-1.el7ev.noarch
Linux version 3.10.0-327.22.2.el7.x86_64 (mockbuild.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) ) #1 SMP Thu Jun 9 10:09:10 EDT 2016
Linux 3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 9 10:09:10 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
Red Hat Enterprise Linux Server release 7.2 (Maipo)

Comment 13 Sandro Bonazzola 2016-07-05 07:44:54 UTC
oVirt 4.0.0 has been released, closing current release.


Note You need to log in before you can comment on or make changes to this bug.