From 808cb0eed84d40c7f90c55bfb9d3f927de3d7f3d Mon Sep 17 00:00:00 2001
From: "Jose A. Lopes" <jabolopes@google.com>
Date: Wed, 21 May 2014 17:25:50 +0200
Subject: [PATCH] Change temporary disk from readonly to read-write

Making the temporary disk readonly has absolutely no advantages and it
has the disadvantage that it prevents the OS install helper from
saving temporary data to it, for example, when downloading the OS
install package which is necessary to run the OS scripts.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
---
 lib/cmdlib/instance.py | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/lib/cmdlib/instance.py b/lib/cmdlib/instance.py
index 3f8fbb186..36a7a5c3d 100644
--- a/lib/cmdlib/instance.py
+++ b/lib/cmdlib/instance.py
@@ -1567,15 +1567,9 @@ class LUInstanceCreate(LogicalUnit):
 
     disk_size = DetermineImageSize(self, install_image, instance.primary_node)
 
-    # KVM does not support readonly disks
-    if instance.hypervisor == constants.HT_KVM:
-      disk_access = constants.DISK_RDWR
-    else:
-      disk_access = constants.DISK_RDONLY
-
     with TemporaryDisk(self,
                        instance,
-                       [(constants.DT_PLAIN, disk_access, disk_size)],
+                       [(constants.DT_PLAIN, constants.DISK_RDWR, disk_size)],
                        feedback_fn):
       feedback_fn("Activating instance disks")
       StartInstanceDisks(self, instance, False)
-- 
GitLab