Closed Satish615 closed 4 years ago
This is code snippet i am using to test the ec2-launch.
import boto3
import platform
print(platform.python_version())
print(boto3.__version__)
instance_type='c5.18xlarge'
boto3.set_stream_logger('')
subnet_id='subnet-8de3e7d6'
name='efa-programmatic'
image_id='ami-0da5089baf511b65f'
security_group_id='sg-ada32ad2'
security_id2='sg-0ccf7f66148293d8a'
args = {'ImageId': image_id,
'InstanceType': instance_type,
'MinCount': 1,
'MaxCount': 1,
'SecurityGroupIds': [],
'KeyName': 'deeplearning-ami-beta'}
args['NetworkInterfaces'] = [{'SubnetId': subnet_id,
'DeviceIndex': 0,
'DeleteOnTermination': True,
'InterfaceType':'efa',
'Groups': [security_group_id,security_id2]}]
placement_specs = {'AvailabilityZone': 'us-east-1d'}
ec2 = boto3.Session(region_name='us-east-1').resource('ec2')
instances = ec2.create_instances(**args)```
@Satish615 - Thank you for your post. I am not getting the same error when i run your code. Can you please verify which version of botocore you are using ? This error comes from botocore so please make sure you are not using older version of botocore.
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
Thank you for your response!. Since the script runs fine in other instances I have debugged on my desktop and found out the AWS_DATA_PATH env variable is being set to /home/
I am trying to launch a new instance with EFA support https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa-working-with.html using boto3. I am getting the below error.
Unknown parameter in NetworkInterfaces[0]: "InterfaceType", must be one of: AssociatePublicIpAddress, DeleteOnTermination, Description, DeviceIndex, Groups, Ipv6AddressCount, Ipv6Addresses, NetworkInterfaceId, PrivateIpAddress, PrivateIpAddresses, SecondaryPrivateIpAddressCount, SubnetId
These are debug logs generated for the issue.