Send a warning notification if there is not enough RAM left to start a VM. Implements #329.

This commit is contained in:
grossmj
2015-10-12 15:57:37 -06:00
parent c700804014
commit ac75977ae0
8 changed files with 38 additions and 1 deletions

View File

@ -247,6 +247,10 @@ class Router(BaseVM):
if elf_header_start != b'\x7fELF\x01\x02\x01':
raise DynamipsError('"{}" is not a valid IOS image'.format(self._image))
# check if there is enough RAM to run
if not self._ghost_flag:
self.check_available_ram(self.ram)
yield from self._hypervisor.send('vm start "{name}"'.format(name=self._name))
self.status = "started"
log.info('router "{name}" [{id}] has been started'.format(name=self._name, id=self._id))