Assign unique filenames to filebased disks
authorIlias Tsitsimpis <iliastsi@grnet.gr>
Tue, 28 Jan 2014 15:23:46 +0000 (17:23 +0200)
committerKlaus Aehlig <aehlig@google.com>
Tue, 28 Jan 2014 16:05:07 +0000 (17:05 +0100)
commit94e252a333f1b04e524f12a48345f92f870dc06f
treee0703e745cfd55f2d6bff8b2f1cad253c39e65f5
parent8dba17978dcc5badcbeee79f380fefa47700ea3b
Assign unique filenames to filebased disks

With the new format for cmdline arguments, the user is able to add a
disk to an instance at a specific index. But filebased disks' filenames
have the form "{0}/disk{1}" where '{0}' is the file_storage_dir and
'{1}' is the index of the disk. So if an instance has 3 disks and we
try to create a new one at index 1, the operation will fail because the
filename "{0}/disk1" already exists.

This patch fixes the above problem and also makes the naming of file and
shared disks uniform with other templates.

Signed-off-by: Ilias Tsitsimpis <iliastsi@grnet.gr>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
lib/cmdlib/instance_storage.py
test/py/ganeti.cmdlib_unittest.py