Revision 41e1e79e lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
8861 | 8861 |
if iobj.disk_template != constants.DT_DISKLESS and not self.adopt_disks: |
8862 | 8862 |
if self.op.mode == constants.INSTANCE_CREATE: |
8863 | 8863 |
if not self.op.no_install: |
8864 |
pause_sync = (iobj.disk_template in constants.DTS_INT_MIRROR and |
|
8865 |
not self.op.wait_for_sync) |
|
8866 |
if pause_sync: |
|
8867 |
feedback_fn("* pausing disk sync to install instance OS") |
|
8868 |
result = self.rpc.call_blockdev_pause_resume_sync(pnode_name, |
|
8869 |
iobj.disks, True) |
|
8870 |
for idx, success in enumerate(result.payload): |
|
8871 |
if not success: |
|
8872 |
logging.warn("pause-sync of instance %s for disk %d failed", |
|
8873 |
instance, idx) |
|
8874 |
|
|
8864 | 8875 |
feedback_fn("* running the instance OS create scripts...") |
8865 | 8876 |
# FIXME: pass debug option from opcode to backend |
8866 | 8877 |
result = self.rpc.call_instance_os_add(pnode_name, iobj, False, |
8867 | 8878 |
self.op.debug_level) |
8879 |
if pause_sync: |
|
8880 |
feedback_fn("* resuming disk sync") |
|
8881 |
result = self.rpc.call_blockdev_pause_resume_sync(pnode_name, |
|
8882 |
iobj.disks, False) |
|
8883 |
for idx, success in enumerate(result.payload): |
|
8884 |
if not success: |
|
8885 |
logging.warn("resume-sync of instance %s for disk %d failed", |
|
8886 |
instance, idx) |
|
8887 |
|
|
8868 | 8888 |
result.Raise("Could not add os for instance %s" |
8869 | 8889 |
" on node %s" % (instance, pnode_name)) |
8870 | 8890 |
|
Also available in: Unified diff