def run_instances(self):
    min_count = int(self.querystring.get('MinCount', ['1'])[0])
    image_id = self.querystring.get('ImageId')[0]
    user_data = self.querystring.get('UserData')
    security_group_names = self._get_multi_param('SecurityGroup')
    security_group_ids = self._get_multi_param('SecurityGroupId')
    nics = dict_from_querystring('NetworkInterface', self.querystring)
    instance_type = self.querystring.get('InstanceType', ['m1.small'])[0]
    placement = self.querystring.get('Placement.AvailabilityZone', [None])[0]
    subnet_id = self.querystring.get('SubnetId', [None])[0]
    private_ip = self.querystring.get('PrivateIpAddress', [None])[0]
    associate_public_ip = self.querystring.get('AssociatePublicIpAddress', [None])[0]
    key_name = self.querystring.get('KeyName', [None])[0]
    if self.is_not_dryrun('RunInstance'):
        new_reservation = self.ec2_backend.add_instances(image_id, min_count, user_data, security_group_names, instance_type=instance_type, placement=placement, subnet_id=subnet_id, key_name=key_name, security_group_ids=security_group_ids, nics=nics, private_ip=private_ip, associate_public_ip=associate_public_ip)
        template = self.response_template(EC2_RUN_INSTANCES)
        return template.render(reservation=new_reservation)
def run_instances(self):
    min_count = int(self.querystring.get('MinCount', ['1'])[0])
    image_id = self.querystring.get('ImageId')[0]
    user_data = self.querystring.get('UserData')
    security_group_names = self._get_multi_param('SecurityGroup')
    security_group_ids = self._get_multi_param('SecurityGroupId')
    nics = dict_from_querystring('NetworkInterface', self.querystring)
    instance_type = self.querystring.get('InstanceType', ['m1.small'])[0]
    placement = self.querystring.get('Placement.AvailabilityZone', [None])[0]
    subnet_id = self.querystring.get('SubnetId', [None])[0]
    private_ip = self.querystring.get('PrivateIpAddress', [None])[0]
    associate_public_ip = self.querystring.get('AssociatePublicIpAddress', [None])[0]
    key_name = self.querystring.get('KeyName', [None])[0]
    if self.is_not_dryrun('RunInstance'):
        new_reservation = self.ec2_backend.add_instances(image_id, min_count, user_data, security_group_names, instance_type=instance_type, placement=placement, subnet_id=subnet_id, key_name=key_name, security_group_ids=security_group_ids, nics=nics, private_ip=private_ip, associate_public_ip=associate_public_ip)
        template = self.response_template(EC2_RUN_INSTANCES)
        return template.render(reservation=new_reservation)