Skip to content
Snippets Groups Projects
Commit d8960502 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix creation of plain instances with --no-wait-for-sync


As reported on the devel mailing list by Christos Stavrakakis,
creation of plain instances is broken when the --no-wait-for-sync flag
is passed, because in that case WaitForSync is not called, hence
SetDiskID is not called at all, resulting in a None physical_id being
passed to backend.

We fix that by explicitly calling SetDiskID, which will cover the
pause/resume and os_add RPC calls.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 3bc145d8
No related branches found
No related tags found
No related merge requests found
......@@ -10138,6 +10138,11 @@ class LUInstanceCreate(LogicalUnit):
_ReleaseLocks(self, locking.LEVEL_NODE_RES)
 
if iobj.disk_template != constants.DT_DISKLESS and not self.adopt_disks:
# we need to set the disks ID to the primary node, since the
# preceding code might or might have not done it, depending on
# disk template and other options
for disk in iobj.disks:
self.cfg.SetDiskID(disk, pnode_name)
if self.op.mode == constants.INSTANCE_CREATE:
if not self.op.no_install:
pause_sync = (iobj.disk_template in constants.DTS_INT_MIRROR and
......
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