Commit 718ed2b4 authored by Romain Courteaud's avatar Romain Courteaud

slapos_upgrader: force migration to remaining compute nodes

parent 6bb9be02
......@@ -33,6 +33,7 @@ if run_count == 1:
############################################
portal.portal_catalog.searchAndActivate(
method_id='ComputeNode_checkSiteMigrationToVirtualMaster',
method_kw={'force_migration': run_count==5},
activate_kw={'tag': tag, 'priority': 1},
portal_type="Compute Node",
......@@ -71,7 +72,7 @@ portal.portal_catalog.searchAndActivate(
)
if run_count < 5:
if run_count < 10:
# Run the migration script multiple times
# Because some object are migrated only after some others are migrated
context.activate(after_tag=tag).Base_triggerFullSiteMigrationToVirtualMasterStep2(run_count=run_count+1)
......
......@@ -63,6 +63,19 @@ elif (computer_network is not None) and (computer_network.getFollowUp(None) is n
compute_node.activate().Base_activateObjectMigrationToVirtualMaster(computer_network.getFollowUp())
not_migrated_compute_node_dict.pop(compute_node_relative_url)
elif force_migration and (not_migrated_compute_node['source_administration'] is not None):
# Create a single project for every single remaining compute node
project = source_administration_value.Person_addVirtualMaster(
title='Migrated shared for %s' % compute_node.getReference(),
is_compute_node_payable=False,
is_instance_tree_payable=False,
# Hardcoded
price_currency='currency_module/EUR',
batch=1
)
compute_node.activate().Base_activateObjectMigrationToVirtualMaster(project.getRelativeUrl())
not_migrated_compute_node_dict.pop(compute_node_relative_url)
else:
# If the related instance are all grouped on this machine, and from the same user
from_same_user_only = True
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None</string> </value>
<value> <string>force_migration=False, REQUEST=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment