Skip to content

systemvm: list systemvm does not return agent state and version#3870

Merged
DaanHoogland merged 2 commits into
apache:4.13from
shapeblue:systemvm-api-agent-status
Feb 7, 2020
Merged

systemvm: list systemvm does not return agent state and version#3870
DaanHoogland merged 2 commits into
apache:4.13from
shapeblue:systemvm-api-agent-status

Conversation

@yadvr
Copy link
Copy Markdown
Member

@yadvr yadvr commented Feb 7, 2020

This makes the listSystemVms API to return the host status (agent state),
version and last pinged information. This makes it possible for UIs
to call a single API to get this information.

This is largely for Primate.

This makes the listSystemVms API to return the host status (agent state),
version and last pinged information. This makes it possible for UIs
to call a single API to get this information.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@yadvr yadvr added this to the 4.13.1.0 milestone Feb 7, 2020
@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Feb 7, 2020

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-777

@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Feb 7, 2020

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Feb 7, 2020

@shwstppr @Pearl1594 please review as well.

@Pearl1594
Copy link
Copy Markdown
Contributor

LGTM - agentstate, lastpinged and version fields seem to be added to the list systemvms response

Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm. seems like an enhancement to me. Primate targets 4.15, should we put it in here?

private String state;

@SerializedName("agentstate")
@Param(description = "the agent state of the system VM")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add since key here as these are new response params

Copy link
Copy Markdown
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Feb 7, 2020

@DaanHoogland the technical preview targets 4.14, without this fix the implementation in Primate would be complicated.

@weizhouapache
Copy link
Copy Markdown
Member

code LGTM

@rhtyd can you make some changes on 4.13/4.14 UI ? the agent state is determined in a complicated way.

@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Feb 7, 2020

That's not very critical, but let me check if it's a quick one. I originally wanted to limit the scope just to apis, wrt Primate.

@DaanHoogland
Copy link
Copy Markdown
Contributor

ok, @rhtyd I'm fine with it. merge at will.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Feb 7, 2020

@shwstppr thanks, fixed the since in params response keys.
@weizhouapache I've fixed the UI as well. Can you review and test the API/UI changes? Thanks.

@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Feb 7, 2020

Thanks @DaanHoogland will merge after smoketests and some UI confirmation (cc @weizhouapache)
@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-784

@DaanHoogland
Copy link
Copy Markdown
Contributor

@weizhouapache can you confirm the ui?

@weizhouapache
Copy link
Copy Markdown
Member

weizhouapache commented Feb 7, 2020

@DaanHoogland ui works.

However, lastping returns wrong date/time. we have same issue on other api response. we can fix them together afterwards.
@DaanHoogland
(1)we have "System.currentTimeMillis() >> 10" in many files, should it be "System.currentTimeMillis() / 1000" ?
(2) considering lastPing saves the timestamp in seconds, we need to display date by "new Date(timestamp * 1000)". If we do not change the ">>10" to 1000, we should use 1024 here.

@DaanHoogland
Copy link
Copy Markdown
Contributor

sounds like a ugly bug @weizhouapache shift by ten bits != /1000. I think we should move away from the bit shifting when dealing with milliseconds.
Would you consider this not to be a blocker for this PR?

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Feb 7, 2020

@weizhouapache
Copy link
Copy Markdown
Member

@DaanHoogland what I said is not a blocker. I am ok with this PR.

@rhtyd yes, it has same issue. In response of listhosts and listsystemvms, both shows the last ping time is "1970-01-XXXX" instead of "2020-02-XXXX". we can fix it in the future, not today.

@DaanHoogland DaanHoogland merged commit afcbbc4 into apache:4.13 Feb 7, 2020
@DaanHoogland DaanHoogland deleted the systemvm-api-agent-status branch February 7, 2020 12:19
ustcweizhou pushed a commit to ustcweizhou/cloudstack that referenced this pull request Feb 28, 2020
…he#3870)

This makes the listSystemVms API to return the host status (agent state),
version and last pinged information. This makes it possible for UIs
to call a single API to get this information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants