@@ -82,6 +82,23 @@ def __init__(
8282 self .target_machines : List [str ] = self .config .active_config .get (
8383 "machines" , ""
8484 ).split ("," )
85+ self .target_instance_types : List [str ] = self .config .active_config .get (
86+ "instance_types" , ""
87+ ).split ("," )
88+ if len (self .target_machines ) == len (self .target_instance_types ):
89+ self .target_instances : Dict [str , str ] = dict (
90+ zip (self .target_machines , self .target_instance_types )
91+ )
92+ else :
93+ print (
94+ "WARNING: Misconfiguration of CLOUDENDURE_INSTANCE_TYPES and CLOUDENDURE_MACHINES. These should be the same length!"
95+ )
96+ self .target_instances = {}
97+
98+ self .lagging_machines : List [str ] = []
99+ self .ready_machines : List [str ] = []
100+ self .nonexistent_machines : List [str ] = []
101+ self .launched_machines : List [str ] = []
85102 self .migration_wave : str = self .config .active_config .get ("migration_wave" , "0" )
86103 self .max_lag_ttl : int = self .config .active_config .get ("max_lag_ttl" , 90 )
87104
@@ -504,6 +521,10 @@ def update_blueprint(self) -> bool:
504521 if self .security_group_id :
505522 blueprint ["securityGroupIDs" ] = [self .security_group_id ]
506523
524+ instance_type = self .target_instances .get (machine_name , "" )
525+ if instance_type :
526+ blueprint ["instanceType" ] = instance_type
527+
507528 # Update machine tags
508529 blueprint ["tags" ] = [
509530 {
@@ -680,8 +701,8 @@ def status(self) -> bool:
680701 )
681702 return False
682703 if not machine_exist :
683- print ("ERROR: Machine: " + _machine + " does not exist!" )
684- return False
704+ print (f "ERROR: Machine: { _machine } does not exist!" )
705+ self . nonexistent_machines . append ( _machine )
685706
686707 if machine_status == len (self .target_machines ):
687708 print ("All Machines in the targeted pool are ready!" )
0 commit comments