Commit 49ce1563 authored by Iustin Pop's avatar Iustin Pop
Browse files

Add check for node memory in instance creation

Currently the check for enough memory is done only on instance start
command and failover command. But we also start an instance in instance
create, therefore we need to check this instead of failing to start in
the hypervisor phase.

The patch adds a check for node memory in the case the creation command
specifies that the instance should be started. It is allowed for the
memory to be less than needed if the instance will not be started, in
order to allow migration and other such cases.

Reviewed-by: imsnah
parent 8a12ce45
......@@ -3486,6 +3486,12 @@ class LUCreateInstance(LogicalUnit):
" destination node '%s'" %
# memory check on primary node
if self.op.start:
"creating instance %s" % self.op.instance_name,
# hvm_cdrom_image_path verification
if self.op.hvm_cdrom_image_path is not None:
if not os.path.isabs(self.op.hvm_cdrom_image_path):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment