Parameter MetadataOptions is not recognized error while instance creation using AWS Boto SDK (old)

I am using the AWS Boto SDK (older version and not the Boto3) to create aws ubuntu24 instance using python script. After selecting the AMI for the instance creation my code fails at the run_instances call with the error : UnknownParameterThe parameter MetadataOptions is not recognized

Code where the error occurred:-
reservation = conn.run_instances(ami, key_name = key, instance_type = instType, block_device_map = bdm, subnet_id = self.awsData.getSubnetId(), security_group_ids=sg, user_data = userScript)
instance = reservation.instances[0]

Earlier the error does not used to come and the instances were getting instantiated without fail.
Could you tell me if there is a metadata parameter nows gets added automatically which the older Boto SDK version is unable to recognize or is there some other issue that needs to handled? What can we do to resolve the issue.

Read more here: Source link