Raise InsufficientFreeMemory
Kind of fixes bug 851374 & bug 858679 Raises InsufficientFreeMemory if an instance can't start because of that. This will cause the normal instance failure recovery to catch this problem, set the state, and log the error. This also removes instance_set_state from db/api.py as that was causing these exceptions in the first place. Change-Id: I199aa6900890531b175e28c3b93d8dfb88e135d0
This commit is contained in:
		@@ -818,3 +818,7 @@ class InstanceTypeMemoryTooSmall(NovaException):
 | 
			
		||||
 | 
			
		||||
class InstanceTypeDiskTooSmall(NovaException):
 | 
			
		||||
    message = _("Instance type's disk is too small for requested image.")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class InsufficientFreeMemory(NovaException):
 | 
			
		||||
    message = _("Insufficient free memory on compute node to start %(uuid)s.")
 | 
			
		||||
 
 | 
			
		||||
@@ -413,7 +413,7 @@ class XenAPIVMTestCase(test.TestCase):
 | 
			
		||||
        self.check_vm_params_for_linux()
 | 
			
		||||
 | 
			
		||||
    def test_spawn_not_enough_memory(self):
 | 
			
		||||
        self.assertRaises(Exception,
 | 
			
		||||
        self.assertRaises(exception.InsufficientFreeMemory,
 | 
			
		||||
                          self._test_spawn,
 | 
			
		||||
                          1, 2, 3, "4")  # m1.xlarge
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user