当我使用 AWS EC2 驱动程序调用create_node和ex_modify_instance_attribute API 时,出现此错误:
引发无效记录错误(err_list[-1]( libcloud.common.types.InvalidCredsError:"AuthFailure: AWS 无法验证提供的访问凭证">
但是ex_create_subnet/list_nodes API 成功,我确信我拥有 AWS IAM 创建 EC2 实例的权限。 顺便说一下,我正在使用AWC cn-north-1区域。
我发现带有一些参数的创建节点将获得身份验证失败 守则:
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']
)