Commit 7bc2c097 authored by Michele Tartara's avatar Michele Tartara

Add support for blktap2 file-driver

Newer Xen versions use blktap2 instead of blktap. This patch adds support
for it in Ganeti.

Fixes Issue 638.
Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
Reviewed-by: default avatarThomas Thrainer <thomasth@google.com>
parent 95e00de7
......@@ -615,6 +615,7 @@ RBD_CMD = "rbd"
# file backend driver
FD_LOOP = "loop"
FD_BLKTAP = "blktap"
FD_BLKTAP2 = "blktap2"
FD_DEFAULT = FD_LOOP
# the set of drbd-like disk types
......@@ -674,7 +675,7 @@ RIE_CONNECT_RETRIES = 10
#: Give child process up to 5 seconds to exit after sending a signal
CHILD_LINGER_TIMEOUT = 5.0
FILE_DRIVER = compat.UniqueFrozenset([FD_LOOP, FD_BLKTAP])
FILE_DRIVER = compat.UniqueFrozenset([FD_LOOP, FD_BLKTAP, FD_BLKTAP2])
# import/export config options
INISECT_EXP = "export"
......
......@@ -47,6 +47,7 @@ _DISK_LETTERS = string.ascii_lowercase
_FILE_DRIVER_MAP = {
constants.FD_LOOP: "file",
constants.FD_BLKTAP: "tap:aio",
constants.FD_BLKTAP2: "tap2:tapdisk:aio",
}
......
......@@ -91,9 +91,9 @@ DISK_%N_FRONTEND_TYPE
DISK_%N_BACKEND_TYPE
How files are visible on the node side. This can be either
``block`` (when using block devices) or ``file:type``, where
``type`` is either ``loop`` or ``blktap`` depending on how the
hypervisor will be configured. Note that not all backend types
apply to all hypervisors.
``type`` is either ``loop``, ``blktap`` or ``blktap2``, depending on how the
hypervisor will be configured. Note that not all backend types apply to all
hypervisors.
NIC_COUNT
Similar to the ``DISK_COUNT``, this represents the number of NICs
......
......@@ -37,7 +37,7 @@ ADD
| [{-B|\--backend-parameters} *BEPARAMS*]
| [{-H|\--hypervisor-parameters} *HYPERVISOR* [: option=*value*... ]]
| [{-O|\--os-parameters} *param*=*value*... ]
| [\--file-storage-dir *dir\_path*] [\--file-driver {loop \| blktap}]
| [\--file-storage-dir *dir\_path*] [\--file-driver {loop \| blktap \| blktap2}]
| {{-n|\--node} *node[:secondary-node]* \| {-I|\--iallocator} *name*}
| {{-o|\--os-type} *os-type*}
| [\--submit]
......@@ -844,6 +844,9 @@ blktap
better performance. Especially if you use a network file system
(e.g. NFS) to store your instances this is the recommended choice.
blktap2
Analogous to the blktap driver, but used by newer versions of Xen.
If ``--ignore-ipolicy`` is given any instance policy violations occuring
during this operation are ignored.
......
......@@ -274,6 +274,9 @@ class TestGetConfigFileDiskData(unittest.TestCase):
(objects.Disk(dev_type=constants.LD_FILE, mode=constants.DISK_RDWR,
physical_id=[constants.FD_LOOP]),
"/tmp/diskThree"),
(objects.Disk(dev_type=constants.LD_FILE, mode=constants.DISK_RDONLY,
physical_id=[constants.FD_BLKTAP2]),
"/tmp/diskFour"),
(objects.Disk(dev_type=constants.LD_FILE, mode=constants.DISK_RDWR,
physical_id=[constants.FD_BLKTAP]),
"/tmp/diskLast"),
......@@ -284,7 +287,8 @@ class TestGetConfigFileDiskData(unittest.TestCase):
"'file:/tmp/diskFirst,sda,w'",
"'tap:aio:/tmp/diskTwo,sdb,r'",
"'file:/tmp/diskThree,sdc,w'",
"'tap:aio:/tmp/diskLast,sdd,w'",
"'tap2:tapdisk:aio:/tmp/diskFour,sdd,r'",
"'tap:aio:/tmp/diskLast,sde,w'",
])
def testInvalidFileDisk(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment