Revision b2e7666a
b/daemons/ganeti-noded | ||
---|---|---|
229 | 229 |
"""Closes the given block devices. |
230 | 230 |
|
231 | 231 |
""" |
232 |
disks = [objects.Disk.FromDict(cf) for cf in params] |
|
233 |
return backend.CloseBlockDevices(disks) |
|
232 |
disks = [objects.Disk.FromDict(cf) for cf in params[1]]
|
|
233 |
return backend.CloseBlockDevices(params[0], disks)
|
|
234 | 234 |
|
235 | 235 |
# export/import -------------------------- |
236 | 236 |
|
b/lib/backend.py | ||
---|---|---|
2073 | 2073 |
return True |
2074 | 2074 |
|
2075 | 2075 |
|
2076 |
def CloseBlockDevices(disks): |
|
2076 |
def CloseBlockDevices(instance_name, disks):
|
|
2077 | 2077 |
"""Closes the given block devices. |
2078 | 2078 |
|
2079 | 2079 |
This means they will be switched to secondary mode (in case of |
2080 | 2080 |
DRBD). |
2081 | 2081 |
|
2082 |
@param instance_name: if the argument is not empty, the symlinks |
|
2083 |
of this instance will be removed |
|
2082 | 2084 |
@type disks: list of L{objects.Disk} |
2083 | 2085 |
@param disks: the list of disks to be closed |
2084 | 2086 |
@rtype: tuple (success, message) |
... | ... | |
2104 | 2106 |
if msg: |
2105 | 2107 |
return (False, "Can't make devices secondary: %s" % ",".join(msg)) |
2106 | 2108 |
else: |
2109 |
if instance_name: |
|
2110 |
_RemoveBlockDevLinks(instance_name) |
|
2107 | 2111 |
return (True, "All devices secondary") |
2108 | 2112 |
|
2109 | 2113 |
|
b/lib/rpc.py | ||
---|---|---|
683 | 683 |
""" |
684 | 684 |
return self._SingleNodeCall(node, "blockdev_find", [disk.ToDict()]) |
685 | 685 |
|
686 |
def call_blockdev_close(self, node, disks): |
|
686 |
def call_blockdev_close(self, node, instance_name, disks):
|
|
687 | 687 |
"""Closes the given block devices. |
688 | 688 |
|
689 | 689 |
This is a single-node call. |
690 | 690 |
|
691 | 691 |
""" |
692 |
return self._SingleNodeCall(node, "blockdev_close",
|
|
693 |
[cf.ToDict() for cf in disks])
|
|
692 |
params = [instance_name, [cf.ToDict() for cf in disks]]
|
|
693 |
return self._SingleNodeCall(node, "blockdev_close", params)
|
|
694 | 694 |
|
695 | 695 |
@classmethod |
696 | 696 |
def call_upload_file(cls, node_list, file_name, address_list=None): |
Also available in: Unified diff