Skip to content
Snippets Groups Projects
Commit 0ea86154 authored by Klaus Aehlig's avatar Klaus Aehlig Committed by Bernardo Dal Seno
Browse files

Restrict instance move to templates based on local files


Moving an instance is done by copying over the disks. Restrict
this to disk templates that are copyable. This avoids accidental
use on, e.g., the sharedfile template.

Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarBernardo Dal Seno <bdalseno@google.com>
parent c148e448
No related branches found
No related tags found
Loading
......@@ -8388,6 +8388,10 @@ class LUInstanceMove(LogicalUnit):
assert self.instance is not None, \
"Cannot retrieve locked instance %s" % self.op.instance_name
 
if instance.disk_template not in constants.DTS_COPYABLE:
raise errors.OpPrereqError("Disk template %s not suitable for copying" %
instance.disk_template, errors.ECODE_STATE)
node = self.cfg.GetNodeInfo(self.op.target_node)
assert node is not None, \
"Cannot retrieve locked node %s" % self.op.target_node
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment