Project

General

Profile

Bug #26480

Add a seatbelt for the amount of memory on the host machine available for VM guests

Added by Marcelo Araujo over 1 year ago. Updated 10 months ago.

Status:
Done
Priority:
Important
Assignee:
Marcelo Araujo
Category:
Middleware
Target version:
Seen in:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

Bhyve doesn't deal well with zfs ARC and all its variable, it is necessary to add some seat belts or otherwise guest machines can crash or be in malfunction.


Related issues

Related to FreeNAS - Bug #34825: Add UI error message for VM memory usageClosed
Related to FreeNAS - Bug #34486: 11.2 Wired Memory maxed while idleClosed

Associated revisions

Revision 2b2b0e0e (diff)
Added by Marcelo Araujo over 1 year ago

Seat belt for vm memory. (#445)

  • feat(middlewared/vm): Add get_memory_in_use() that returns the amount of memory used by all running guests. Add get_provisioned_memory() that returns the memory necessary to be provisioned in next boot.
  • feat(middlewared/vm): Rename memory to virtual memory, just to be more clear.
  • feat(middlewared/vm): Simplify how to get memory in use and provisioned memory.
  • feat(middlewared/vm): feat(middlewared/vm): Seat belt on guests that has been given more virtual resources than are physically available. Also it is necessary resize ZFS arc_max to avoid ZFS uses all memory and make guests using swap that can lead a guest to crash.

We keep at least 35% of memory from initial arc_max value, every time we start a guest, we check if we have enough memory on usermem and also if it is possible to shrink arc_max subtracting the amount of memory requested by the guest; if we have enough resources, the guest is initialized and the method start() will return True, otherwise it will return False.

When we stop a guest, we give back that amount of memory to arc_max.

  • feat(middleared/vm): Do not get the arc_max so earlier, also fix the comparison of resize_arc and ZFS_ARC_MAX.
  • feat(middlewared/vm): Make the ARC resize calculation be bit more precise.
  • feat(middlewared/vm): Show the vm ID on error output.
  • feat(middlewared/vm): It must be less or equal.
  • feat(middlewared/vm): Move teardown_guest_vmemory under VMSupervisor class, now it gives memory back to arc_max in case VM crash, same applies when 'halt' or 'shutdown' is performed inside the guest.

Ticket: #26480

Revision 48d7d479 (diff)
Added by Dru Lavigne 12 months ago

Mention VMs seatbelt.
Ticket: #26480

History

#1 Updated by Marcelo Araujo over 1 year ago

  • Status changed from Screened to Ready For Release

It is own master already!

#2 Updated by Dru Lavigne about 1 year ago

  • Subject changed from Seat belt for the amount of memory on the host machine available for guests. to Add a seatbelt for the amount of memory on the host machine available for VM guests
  • Status changed from Ready For Release to Done
  • Needs Merging changed from Yes to No

#3 Updated by Dru Lavigne 12 months ago

  • Status changed from Done to Ready for Testing

#4 Updated by Dru Lavigne 12 months ago

  • Severity set to New
  • Needs Doc changed from Yes to No

#5 Updated by Timothy Moore II 10 months ago

  • Related to Bug #34825: Add UI error message for VM memory usage added

#6 Updated by Timothy Moore II 10 months ago

  • Status changed from Ready for Testing to Passed Testing

Behaves as expected, although the UI will need to display the error message.

#7 Updated by Dru Lavigne 10 months ago

  • Status changed from Passed Testing to Done
  • Needs QA changed from Yes to No

#8 Updated by Dru Lavigne 10 months ago

  • Related to Bug #34486: 11.2 Wired Memory maxed while idle added

Also available in: Atom PDF