ex_modify_instance_attribute和create_node有AuthFailure错误使用apache-libcloud AWS EC2驱动程序

时间:2017-07-20 00:29:26

标签: libcloud

当我使用AWS EC2驱动程序调用create_node和ex_modify_instance_attribute API时,我收到此错误:

引发InvalidCredsError(err_list [-1]) libcloud.common.types.InvalidCredsError:' AuthFailure:AWS无法验证提供的访问凭据'

但ex_create_subnet / list_nodes API成功,我确信我拥有AWS IAM创建EC2实例的权限。 顺便说一句,我正在使用AWC cn-north-1区域。

1 个答案:

答案 0 :(得分:0)

我发现带有一些参数的create node会得到AuthFailure 守则:

 node = self.conn.create_node(name=instance_name,
                              image=image,
                              size=size,
                              ex_keyname=ex_keyname,                                                   
                              ex_iamprofile=ex_iamprofile,
                              ex_subnet=ex_subnet,                                                    
                           ex_security_group_ids=ex_security_group_ids,
                              ex_mincount=ex_mincount,
                              ex_maxcount=ex_mincount,                                                    
                        ex_blockdevicemappings=config['block_devices'],                                                     
                        ex_assign_public_ip=config['eth0']['need_eip']
                             )

我只是删除了一些参数并且有效:

 node = self.conn.create_node(name=instance_name,
                                                 image=image,
                                                 size=size,
                                                 ex_keyname=ex_keyname,
                                                 # ex_iamprofile=ex_iamprofile,
                                                 ex_subnet=ex_subnet,
                                                 # ex_security_group_ids=ex_security_group_ids,
                                                 ex_mincount=ex_mincount,
                                                 ex_maxcount=ex_mincount,
                                                 # ex_blockdevicemappings=config['block_devices'],
                                                 # ex_assign_public_ip=config['eth0']['need_eip']
                                                 )