Skip to content

Adding memoryallocatedpercentage & memoryallocatedbytes to HostsResponse & HostsForMigrationResponse - #4478

Merged
DaanHoogland merged 1 commit into
apache:4.14from
shapeblue:fix-host-resp
Nov 20, 2020
Merged

Adding memoryallocatedpercentage & memoryallocatedbytes to HostsResponse & HostsForMigrationResponse#4478
DaanHoogland merged 1 commit into
apache:4.14from
shapeblue:fix-host-resp

Conversation

@davidjumani

@davidjumanidavidjumani commented Nov 18, 2020

Copy link
Copy Markdown
Contributor

Description

Fixes#4460

Adds memoryallocatedpercentage & memoryallocatedbytes to HostsResponse as well as HostsForMigrationResponse and deprecates memoryallocated

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)

How Has This Been Tested?

(localhost) 🐱 > list hosts filter=cpuallocated,memoryallocated,memoryallocatedbytes,memoryallocatedpercentage, type=Routing
{
"count": 2,
"host": [
{
"cpuallocated": "6.25%",
"memoryallocated": 2415919104,
"memoryallocatedbytes": 2415919104,
"memoryallocatedpercentage": "28.12%"
},
{
"cpuallocated": "1.56%",
"memoryallocated": 536870912,
"memoryallocatedbytes": 536870912,
"memoryallocatedpercentage": "6.25%"
}
]
}
(localhost) 🐱 > find hostsformigration virtualmachineid=e3c2c89a-26b3-427e-bc4a-34caeedf466a filter=cpuallocated,memoryallocated,memoryallocatedbytes,memoryallocatedpercentage, type=Routing
{
"count": 2,
"host": [
{
"cpuallocated": "1.56%",
"memoryallocated": "6.25%",
"memoryallocatedbytes": 536870912,
"memoryallocatedpercentage": "6.25%"
}
]
}

@davidjumani

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@davidjumani

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@davidjumani

Copy link
Copy Markdown
ContributorAuthor

@weizhouapache Is it fine that the memory is numeric but CPU is in percentage ? Or would it be better to have new memoryallocaedpercentage & cpuallocaedpercentage fields ?

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2400

@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

@weizhouapache

Copy link
Copy Markdown
Member

@weizhouapache Is it fine that the memory is numeric but CPU is in percentage ? Or would it be better to have new memoryallocaedpercentage & cpuallocaedpercentage fields ?

@davidjumani it would be better. but it might break backwards compatibility (hope few users will be impacted).

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3198)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 30749 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4478-t3198-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
Smoke tests completed. 83 look OK, 0 have error(s)
Only failed tests results shown below:

TestResultTime (s)Test File

hostResponse.setMemWithOverprovisioning(decimalFormat.format(memWithOverprovisioning));
hostResponse.setMemoryAllocated(decimalFormat.format((float) mem / memWithOverprovisioning * 100.0f) +"%");
hostResponse.setMemoryAllocated(mem);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will this cause regression?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

It will but we can introduce two new fields memoryallocaedpercentage & cpuallocaedpercentage to compensate.
This will ensure that the response for both HostResponse and HostForMigrationResponse will be the same. Sounds good @rhtyd ?

@DaanHoogland

Copy link
Copy Markdown
Contributor

€0,02: we can add responce parameters that are alligned for both -precentages and -values and leave these alone alltogether. @weizhouapache @rhtyd @davidjumani ?

@weizhouapache

Copy link
Copy Markdown
Member

€0,02: we can add responce parameters that are alligned for both -precentages and -values and leave these alone alltogether. @weizhouapache @rhtyd @davidjumani ?

@DaanHoogland good to me. and mark the cpuallocated and memoryallocated as deprecated ?

@DaanHoogland

Copy link
Copy Markdown
Contributor

€0,02: we can add responce parameters that are alligned for both -precentages and -values and leave these alone alltogether. @weizhouapache @rhtyd @davidjumani ?

@DaanHoogland good to me. and mark the cpuallocated and memoryallocated as deprecated ?

yes

@davidjumani

Copy link
Copy Markdown
ContributorAuthor

€0,02: we can add responce parameters that are alligned for both -precentages and -values and leave these alone alltogether. @weizhouapache @rhtyd @davidjumani ?

@DaanHoogland good to me. and mark the cpuallocated and memoryallocated as deprecated ?

yes

Sounds good! I'll make the changes

@davidjumanidavidjumani changed the title hostformigrationresponse: Setting memory allocated to longAdding memoryallocatedpercentage & memoryallocatedbytes to HostsResponse & HostsForMigrationResponseNov 20, 2020
@davidjumani

Copy link
Copy Markdown
ContributorAuthor

@DaanHoogland@weizhouapache Added memoryallocatedpercentage & memoryallocatedbytes and deprecated memoryallocated

@DaanHoogland

Copy link
Copy Markdown
Contributor

yes 👍 don't bother for now but I'm creating a ticket do implement the same for cpu #4488

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland 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: ✔centos7 ✖centos8 ✔debian. JID-2413

@DaanHoogland

Copy link
Copy Markdown
Contributor

I don't think we need smoke tests for this. restarted two of the travis runs

@DaanHoogland
DaanHoogland merged commit d79d242 into apache:4.14Nov 20, 2020
@DaanHoogland
DaanHoogland deleted the fix-host-resp branch November 20, 2020 11:27
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@davidjumani@blueorangutan@DaanHoogland@weizhouapache@yadvr