# dictionary with instance information after the modification
ispec = {}
- if self.op.hotplug:
+ if self.op.hotplug or self.op.hotplug_if_possible:
result = self.rpc.call_hotplug_supported(self.instance.primary_node,
self.instance)
- # result.Raise("Hotplug is not supported.")
if result.fail_msg:
- self.LogWarning(result.fail_msg)
- self.op.hotplug = False
- self.LogInfo("Continuing execution..")
+ if self.op.hotplug:
+ result.Raise("Hotplug is not possible: %s" % result.fail_msg,
+ prereq=True)
+ else:
+ self.LogWarning(result.fail_msg)
+ self.op.hotplug = False
+ self.LogInfo("Modification will take place without hotplugging.")
+ else:
+ self.op.hotplug = True
# Check disk modifications. This is done here and not in CheckArguments
# (as with NICs), because we need to know the instance's disk template