Revision ba924970 lib/cmdlib/instance_storage.py
b/lib/cmdlib/instance_storage.py | ||
---|---|---|
1211 | 1211 |
ignored. |
1212 | 1212 |
|
1213 | 1213 |
""" |
1214 |
lu.cfg.MarkInstanceDisksInactive(instance.uuid) |
|
1215 | 1214 |
all_result = True |
1215 |
|
|
1216 |
if disks is None: |
|
1217 |
# only mark instance disks as inactive if all disks are affected |
|
1218 |
lu.cfg.MarkInstanceDisksInactive(instance.uuid) |
|
1216 | 1219 |
disks = ExpandCheckDisks(instance, disks) |
1217 | 1220 |
|
1218 | 1221 |
for disk in disks: |
... | ... | |
1240 | 1243 |
|
1241 | 1244 |
|
1242 | 1245 |
def AssembleInstanceDisks(lu, instance, disks=None, ignore_secondaries=False, |
1243 |
ignore_size=False):
|
|
1246 |
ignore_size=False): |
|
1244 | 1247 |
"""Prepare the block devices for an instance. |
1245 | 1248 |
|
1246 | 1249 |
This sets up the block devices on all nodes. |
... | ... | |
1265 | 1268 |
""" |
1266 | 1269 |
device_info = [] |
1267 | 1270 |
disks_ok = True |
1271 |
|
|
1272 |
if disks is None: |
|
1273 |
# only mark instance disks as active if all disks are affected |
|
1274 |
lu.cfg.MarkInstanceDisksActive(instance.uuid) |
|
1275 |
|
|
1268 | 1276 |
disks = ExpandCheckDisks(instance, disks) |
1269 | 1277 |
|
1270 | 1278 |
# With the two passes mechanism we try to reduce the window of |
... | ... | |
1276 | 1284 |
# into any other network-connected state (Connected, SyncTarget, |
1277 | 1285 |
# SyncSource, etc.) |
1278 | 1286 |
|
1279 |
# mark instance disks as active before doing actual work, so watcher does |
|
1280 |
# not try to shut them down erroneously |
|
1281 |
lu.cfg.MarkInstanceDisksActive(instance.uuid) |
|
1282 |
|
|
1283 | 1287 |
# 1st pass, assemble on all nodes in secondary mode |
1284 | 1288 |
for idx, inst_disk in enumerate(disks): |
1285 | 1289 |
for node_uuid, node_disk in inst_disk.ComputeNodeTree( |
... | ... | |
1321 | 1325 |
inst_disk.iv_name, lu.cfg.GetNodeName(node_uuid), msg) |
1322 | 1326 |
disks_ok = False |
1323 | 1327 |
else: |
1324 |
dev_path = result.payload |
|
1328 |
dev_path, _ = result.payload
|
|
1325 | 1329 |
|
1326 | 1330 |
device_info.append((lu.cfg.GetNodeName(instance.primary_node), |
1327 | 1331 |
inst_disk.iv_name, dev_path)) |
Also available in: Unified diff