@@ -82,6 +82,19 @@ 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 ("instance_types" , "" ).split ("," )
86+ if len (self .target_machines ) == len (self .target_instance_types ):
87+ self .target_instances : Dict [str , str ] = dict (zip (self .target_machines , self .target_instance_types ))
88+ else :
89+ print (
90+ "WARNING: Misconfiguration of CLOUDENDURE_INSTANCE_TYPES and CLOUDENDURE_MACHINES. These should be the same length!"
91+ )
92+ self .target_instances = {}
93+
94+ self .lagging_machines : List [str ] = []
95+ self .ready_machines : List [str ] = []
96+ self .nonexistent_machines : List [str ] = []
97+ self .launched_machines : List [str ] = []
8598 self .migration_wave : str = self .config .active_config .get ("migration_wave" , "0" )
8699 self .max_lag_ttl : int = self .config .active_config .get ("max_lag_ttl" , 90 )
87100
@@ -504,6 +517,10 @@ def update_blueprint(self) -> bool:
504517 if self .security_group_id :
505518 blueprint ["securityGroupIDs" ] = [self .security_group_id ]
506519
520+ instance_type = self .target_instances .get (machine_name , "" )
521+ if instance_type :
522+ blueprint ["instanceType" ] = instance_type
523+
507524 # Update machine tags
508525 blueprint ["tags" ] = [
509526 {
@@ -680,8 +697,8 @@ def status(self) -> bool:
680697 )
681698 return False
682699 if not machine_exist :
683- print ("ERROR: Machine: " + _machine + " does not exist!" )
684- return False
700+ print (f "ERROR: Machine: { _machine } does not exist!" )
701+ self . nonexistent_machines . append ( _machine )
685702
686703 if machine_status == len (self .target_machines ):
687704 print ("All Machines in the targeted pool are ready!" )
0 commit comments