Fix disk adoption interaction with ipolicy checks
authorIustin Pop <iustin@google.com>
Fri, 19 Oct 2012 13:19:48 +0000 (15:19 +0200)
committerIustin Pop <iustin@google.com>
Fri, 19 Oct 2012 13:57:41 +0000 (15:57 +0200)
commitba147ff8fe1a6603263022e032511005e58a32ab
treefe122caebb5b004716cbfa347db6cdd011935ade
parent312620ad30f97956c7b1006ec9f8e2c58bd71b18
Fix disk adoption interaction with ipolicy checks

In Ganeti 2.6, disk adoption is broken due to the ipolicy checks being
done before we read volume size from remote nodes. We fix this by
simply moving these checks to after the disk adoption code which
updates the disk size; it's not that nice that we fail a (almost)
config-level check after we've reserved the LVs, etc., but we need to
do so in order to validate the ipolicy correctly.

Tested:

- normal instance creation
- creation via adoption with good size (pass)
- creation via adoption with wrong LV size (fail as expected)
- QA in progress

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
lib/cmdlib.py