Revision 3c260845 lib/cmdlib/instance.py
b/lib/cmdlib/instance.py | ||
---|---|---|
2748 | 2748 |
constants.DT_EXT), |
2749 | 2749 |
errors.ECODE_INVAL) |
2750 | 2750 |
|
2751 |
if not self.op.wait_for_sync and self.instance.disks_active: |
|
2752 |
for mod in self.diskmod: |
|
2753 |
if mod[0] == constants.DDM_ADD: |
|
2754 |
raise errors.OpPrereqError("Can't add a disk to an instance with" |
|
2755 |
" activated disks and" |
|
2756 |
" --no-wait-for-sync given.", |
|
2757 |
errors.ECODE_INVAL) |
|
2758 |
|
|
2751 | 2759 |
if self.op.disks and self.instance.disk_template == constants.DT_DISKLESS: |
2752 | 2760 |
raise errors.OpPrereqError("Disk operations not supported for" |
2753 | 2761 |
" diskless instances", errors.ECODE_INVAL) |
... | ... | |
3244 | 3252 |
raise errors.OpExecError("Failed to sync disks of %s" % |
3245 | 3253 |
self.instance.name) |
3246 | 3254 |
|
3255 |
# the disk is active at this point, so deactivate it if the instance disks |
|
3256 |
# are supposed to be inactive |
|
3257 |
if not self.instance.disks_active: |
|
3258 |
ShutdownInstanceDisks(self, self.instance, disks=[disk]) |
|
3259 |
|
|
3247 | 3260 |
@staticmethod |
3248 | 3261 |
def _ModifyDisk(idx, disk, params, _): |
3249 | 3262 |
"""Modifies a disk. |
Also available in: Unified diff