Skip to content

server: use host record related to a ssvm/cpvm#3876

Merged
yadvr merged 1 commit intoapache:4.13from
shapeblue:systemvm-agent-regression-fix
Feb 10, 2020
Merged

server: use host record related to a ssvm/cpvm#3876
yadvr merged 1 commit intoapache:4.13from
shapeblue:systemvm-agent-regression-fix

Conversation

@yadvr
Copy link
Copy Markdown
Member

@yadvr yadvr commented Feb 10, 2020

This implements the systemvm list API response creator to find and use
the host record for a ssvm/cpvm to get the agent status and other
details like last disconnected date and agent version.

Fixes #3875

Signed-off-by: Rohit Yadav rohit.yadav@shapeblue.com

Description

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

This implements the systemvm list API response creator to find and use
the host record for a ssvm/cpvm to get the agent status and other
details like last disconnected date and agent version.

Fixes 3875

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

yadvr commented Feb 10, 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-795

@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Feb 10, 2020

API response on fresh zone deployment when VMs are not up:

    {
      "created": "2020-02-10T11:36:11+0530",
      "dns1": "8.8.8.8",
      "gateway": "172.20.0.1",
      "hostid": "5735265e-cc04-4b97-8e9f-9a78e6d99855",
      "hostname": "monkeybox-centos7-kvm1",
      "hypervisor": "KVM",
      "id": "2e7293a0-d168-46f3-bc29-262ddbf22474",
      "linklocalip": "169.254.58.140",
      "linklocalmacaddress": "0e:00:a9:fe:3a:8c",
      "linklocalnetmask": "255.255.0.0",
      "name": "s-2-VM",
      "podid": "c630a58b-6aa4-4a37-84a0-6cc8d711138b",
      "privateip": "172.20.25.120",
      "privatemacaddress": "1e:00:03:00:00:6f",
      "privatenetmask": "255.255.0.0",
      "publicip": "172.20.20.199",
      "publicmacaddress": "1e:00:81:00:01:7d",
      "publicnetmask": "255.255.0.0",
      "state": "Starting",
      "systemvmtype": "secondarystoragevm",
      "templateid": "d46f0da6-4bca-11ea-bb57-f4d1082409e6",
      "zoneid": "03a01cbf-aea2-4ea9-b2ff-c7c6394fad53",
      "zonename": "KVM-advzone"
    }

On/after connected:

    {
      "agentstate": "Up",
      "created": "2020-02-10T11:36:11+0530",
      "dns1": "8.8.8.8",
      "gateway": "172.20.0.1",
      "hostid": "5735265e-cc04-4b97-8e9f-9a78e6d99855",
      "hostname": "monkeybox-centos7-kvm1",
      "hypervisor": "KVM",
      "id": "2e7293a0-d168-46f3-bc29-262ddbf22474",
      "linklocalip": "169.254.58.140",
      "linklocalmacaddress": "0e:00:a9:fe:3a:8c",
      "linklocalnetmask": "255.255.0.0",
      "name": "s-2-VM",
      "podid": "c630a58b-6aa4-4a37-84a0-6cc8d711138b",
      "privateip": "172.20.25.120",
      "privatemacaddress": "1e:00:03:00:00:6f",
      "privatenetmask": "255.255.0.0",
      "publicip": "172.20.20.199",
      "publicmacaddress": "1e:00:81:00:01:7d",
      "publicnetmask": "255.255.0.0",
      "state": "Running",
      "systemvmtype": "secondarystoragevm",
      "templateid": "d46f0da6-4bca-11ea-bb57-f4d1082409e6",
      "version": "4.13.1.0-SNAPSHOT",
      "zoneid": "03a01cbf-aea2-4ea9-b2ff-c7c6394fad53",
      "zonename": "KVM-advzone"
    }

UI also calls a single API now:
Screenshot from 2020-02-10 11-40-36

Since, this is purely API response change with manual testing, Travis smoketests should be enough.

@weizhouapache
Copy link
Copy Markdown
Member

@rhtyd tested ok.

Just a question, why did you replace lastping with disconnected in response ? we can keep both.

@yadvr
Copy link
Copy Markdown
Member Author

yadvr commented Feb 10, 2020

@weizhouapache that value is not updated in the DB, in my test it always was new Date(1543447795) or Mon Jan 19 02:14:07 IST 1970

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 based on code changes and API response

@Pearl1594
Copy link
Copy Markdown
Contributor

LGTM

@weizhouapache
Copy link
Copy Markdown
Member

@weizhouapache that value is not updated in the DB, in my test it always was new Date(1543447795) or Mon Jan 19 02:14:07 IST 1970

@rhtyd oh yes. cloud service does not send PingCommand to management server every minute.

@yadvr yadvr merged commit 78cc0a4 into apache:4.13 Feb 10, 2020
ustcweizhou pushed a commit to ustcweizhou/cloudstack that referenced this pull request Feb 28, 2020
This implements the systemvm list API response creator to find and use
the host record for a ssvm/cpvm to get the agent status and other
details like last disconnected date and agent version.

Fixes 3875

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants