Softlayer API 激活存储故障转移

Softlayer API to activate storage failover

我正在尝试通过 Softlayer API 激活存储的故障转移。 我写了这段代码

import SoftLayer
API_USERNAME = 'xxx'
API_KEY = 'yyy'
iscsiId_primary = AAAA
iscsiId_replica = BBBB
client = SoftLayer.Client(username=API_USERNAME, api_key=API_KEY)
networkStorageService = client['SoftLayer_Network_Storage']

networkStorageService.FailoverToReplicant(id=iscsiId_primary)   

控制台返回了这个错误

SoftLayerAPIError(SoftLayer_Exception_InvalidValue): Invalid value provided for 'The replicant id provided is not part of the replication partners associated to this volume.'.

如果我尝试放置副本存储 ID,错误是

SoftLayerAPIError(SoftLayer_Exception_Public): Replication is not supported by this storage type.

我认为故障转移函数的调用不正确。有人可以给我发送正确的语法吗?

非常感谢

根据SoftLayer_Network_Storage方法,需要指定"replicantId"参数。

在您的代码中尝试以下操作:

networkStorageService.FailoverToReplicant(iscsiId_replica, id=iscsiId_primary)   

希望对你有帮助