Doron Fediuck has posted comments on this change. Change subject: External Scheduler: Add memory example ......................................................................
Patch Set 2: (7 comments) Very cool! Please make the default chosen VM the smaller one to be on the safe side, and provide an option to use the largest VM if someone cares to give it a try. Please document well and explain the above. .................................................... Commit Message Line 3: AuthorDate: 2013-10-07 16:13:27 +0300 Line 4: Commit: Noam Slomianko <[email protected]> Line 5: CommitDate: 2013-10-07 16:32:06 +0300 Line 6: Line 7: External Scheduler: Add memory example Since all commits in this project belong to external scheduler, let's try something else; Samples: add memory based load-balancing smaple module Line 8: Line 9: Adds a comprihensive example of a memory filter. Line 10: Filter stages: Line 11: - finds the host with the least amount of free memory Line 6: Line 7: External Scheduler: Add memory example Line 8: Line 9: Adds a comprihensive example of a memory filter. Line 10: Filter stages: Filter belongs somewhere else. Let's try "logic:" Line 11: - finds the host with the least amount of free memory Line 12: - checks what is the maximum vm size it can pass to Line 13: the other hosts without overloading them Line 14: - find a vm it can pass that is small enough to .................................................... File plugins/examples/host_memory_balance.py Line 7: '''moves a vm from a host with to many''' Line 8: Line 9: #What are the values this module will accept, used to present Line 10: #the user with options Line 11: properties_validation = 'minimum_host_memory=[0-9]*' Please specify the units in the name. ie- minimum_host_memory_MB Line 12: Line 13: def _get_connection(self): Line 14: #open a connection to the rest api Line 15: connection = None Line 36: 'memory.free').get_values().get_value()[0].get_datum() Line 37: except: Line 38: return -1 Line 39: Line 40: def filterHosts(self, engine_hosts, minimum_host_memory): Please rename to something like get_over_under_utilized_hosts. Line 41: '''return the most overloaded host, Line 42: and a list of under utilized hosts''' Line 43: over_loaded_host = None Line 44: white_listed_hosts = [] Line 38: return -1 Line 39: Line 40: def filterHosts(self, engine_hosts, minimum_host_memory): Line 41: '''return the most overloaded host, Line 42: and a list of under utilized hosts''' let agree on terminology: overloaded: overutilized white/...: underutilized Line 43: over_loaded_host = None Line 44: white_listed_hosts = [] Line 45: for engine_host in engine_hosts: Line 46: if(engine_host): Line 41: '''return the most overloaded host, Line 42: and a list of under utilized hosts''' Line 43: over_loaded_host = None Line 44: white_listed_hosts = [] Line 45: for engine_host in engine_hosts: why engine_host and not simply host? Line 46: if(engine_host): Line 47: free_memory = self.getFreeMemory(engine_host) Line 48: if(free_memory <= 0): Line 49: continue Line 50: if free_memory > minimum_host_memory: Line 51: white_listed_hosts.append(engine_host) Line 52: continue Line 53: #take the host with least amount of free memory Line 54: if not over_loaded_host or \ The pythonic way is: if over_loaded_host is None or Also, concatenation is mostly used in scripts, so let's avoid it here and simply break the line. Line 55: self.getFreeMemory(over_loaded_host) \ Line 56: > free_memory: Line 57: over_loaded_host = engine_host Line 58: return over_loaded_host, white_listed_hosts -- To view, visit http://gerrit.ovirt.org/19934 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b4a41064631912f5624723327a2ff5ebf158d5c Gerrit-PatchSet: 2 Gerrit-Project: ovirt-scheduler-proxy Gerrit-Branch: master Gerrit-Owner: Noam Slomianko <[email protected]> Gerrit-Reviewer: Doron Fediuck <[email protected]> Gerrit-Reviewer: Gilad Chaplik <[email protected]> Gerrit-Reviewer: Martin Sivák <[email protected]> Gerrit-Reviewer: Noam Slomianko <[email protected]> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
