Revision 2a139bb0 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
4877 | 4877 |
if instance.disk_template not in constants.DTS_NET_MIRROR: |
4878 | 4878 |
raise errors.OpPrereqError("Can't relocate non-mirrored instances") |
4879 | 4879 |
|
4880 |
if len(instance.secondary_nodes) != 1: |
|
4881 |
raise errors.OpPrereqError("Instance has not exactly one secondary node") |
|
4882 |
|
|
4880 | 4883 |
self.required_nodes = 1 |
4881 | 4884 |
|
4882 | 4885 |
disk_space = _ComputeDiskSize(instance.disk_template, |
... | ... | |
4884 | 4887 |
instance.disks[1].size) |
4885 | 4888 |
|
4886 | 4889 |
request = { |
4887 |
"type": "replace_secondary",
|
|
4890 |
"type": "relocate",
|
|
4888 | 4891 |
"name": self.name, |
4889 | 4892 |
"disk_space_total": disk_space, |
4890 | 4893 |
"required_nodes": self.required_nodes, |
4894 |
"nodes": list(instance.secondary_nodes), |
|
4891 | 4895 |
} |
4892 | 4896 |
self.in_data["request"] = request |
4893 | 4897 |
|
Also available in: Unified diff