Revision 4a2c0db0
b/lib/cmdlib.py | ||
---|---|---|
7692 | 7692 |
self.cfg.ReleaseDRBDMinors(instance) |
7693 | 7693 |
raise |
7694 | 7694 |
|
7695 |
if self.cfg.GetClusterInfo().prealloc_wipe_disks: |
|
7696 |
feedback_fn("* wiping instance disks...") |
|
7697 |
try: |
|
7698 |
_WipeDisks(self, iobj) |
|
7699 |
except errors.OpExecError: |
|
7700 |
self.LogWarning("Device wiping failed, reverting...") |
|
7701 |
try: |
|
7702 |
_RemoveDisks(self, iobj) |
|
7703 |
finally: |
|
7704 |
self.cfg.ReleaseDRBDMinors(instance) |
|
7705 |
raise |
|
7706 |
|
|
7707 | 7695 |
feedback_fn("adding instance %s to cluster config" % instance) |
7708 | 7696 |
|
7709 | 7697 |
self.cfg.AddInstance(iobj, self.proc.GetECId()) |
... | ... | |
7722 | 7710 |
self.context.glm.release(locking.LEVEL_NODE) |
7723 | 7711 |
del self.acquired_locks[locking.LEVEL_NODE] |
7724 | 7712 |
|
7725 |
if self.op.wait_for_sync: |
|
7713 |
disk_abort = False |
|
7714 |
if not self.adopt_disks and self.cfg.GetClusterInfo().prealloc_wipe_disks: |
|
7715 |
feedback_fn("* wiping instance disks...") |
|
7716 |
try: |
|
7717 |
_WipeDisks(self, iobj) |
|
7718 |
except errors.OpExecError, err: |
|
7719 |
logging.exception("Wiping disks failed") |
|
7720 |
self.LogWarning("Wiping instance disks failed (%s)", err) |
|
7721 |
disk_abort = True |
|
7722 |
|
|
7723 |
if disk_abort: |
|
7724 |
# Something is already wrong with the disks, don't do anything else |
|
7725 |
pass |
|
7726 |
elif self.op.wait_for_sync: |
|
7726 | 7727 |
disk_abort = not _WaitForSync(self, iobj) |
7727 | 7728 |
elif iobj.disk_template in constants.DTS_NET_MIRROR: |
7728 | 7729 |
# make sure the disks are not degraded (still sync-ing is ok) |
Also available in: Unified diff