Move config.py to config/__init__.py for split

config.py broke the maximal module size and needs to be refactored. For
this purpose, it will first be moved into a module directory.

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Move temporary reservation manager to separate file

The temporary reservation manager is sufficiently independent to be
moved to a separte submodule.

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Move ConfigSync and ConfigManager to config.utils

This is preparing to split ConfigWriter.

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Add mini-docstring for DetachedConfig

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Document problem with ConfigWriter class

This comment should show lines along which the ConfigWriter class can be
split.

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Allow attach to diskless instance

Because the new definition of diskless is not having disks,
attaching/adding disks to the instance should be possible.

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Update design disks: goal of backwards compatibility

For many users the change from uniform disk templates would make their
lifes more difficult. Therefore we want to be externally compatible as
far as possible.

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Move cmdlib.instance_storage.*DiskOfType to project utils

More and more parts of the code use it to check if a certain operation
is appropriate. The refactor reflects that this is a general helper and
no longer specific to instances

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Remove backend.py dependency on disk_template

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Make cluster disable disk template error future proof

So far the error only showed that there are disks of a certain template
and that that template can therefore not be disabled. The new error also
shows on what instance (if any) it is mounted.

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Add more documentation to _ExecuteKVMRuntime

Some arguments are not described, this commit adds at least superficial
information.

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Replace generic name in kvm unittest

A test console is created with _Test. This patch renames it to
MakeConsole.

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Simplify test logic in kvm unittest

Many of the KVM related unittests are multiple tests in a single method
and include non-trivial logic. This patch splits the tests in multiple
methods, each of which has trivial logic.

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Move config mock to testutils

The config mock is usable not only by cmdlib tests, so this patch moves
it to a place where it's available to all tests.

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Add limited tests for KVMHypervisor

KVMHypervisor is 2200 lines long and mostly untested. This patch starts
an effort to add tests for this class.

Signed-off-by: Aaron Karper <akarper@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>