英文:
What is the algorithm to delete the dependencies of an InstanceGroup in the ibm cloud vpc
问题
以下是要翻译的内容:
代码部分:
service.DeleteInstanceGroup(service.NewDeleteInstanceGroupOptions(id))
出现了错误。错误信息是Delete locked, membership count must be 0 to delete InstanceGroup
。
这是一个正确的陈述,成员计数为1。看起来需要先删除实例组的依赖项,然后再删除实例组。
删除实例组的依赖项的算法是什么?
英文:
snippet:
service.DeleteInstanceGroup(service.NewDeleteInstanceGroupOptions(id))
Is failing. The error message is Delete locked, membership count must be 0 to delete InstanceGroup
This is a true statement the membership count is 1. It looks like the InstanceGroup dependencies need to be deleted before the instance group.
What is the algorithm to delete the dependencies of an InstanceGroup?
答案1
得分: 1
例如,要删除实例组,必须将成员计数更新为零,然后等待实例组状态再次变为健康,然后删除该组。
步骤如下:
- 检查实例组状态是否健康,如果不健康,则等待。
- 如果健康,则将成员计数更新为零。
updateInstanceGroup := &vpcv1.UpdateInstanceGroupOptions{
ID: &id,
}
zeroCount := int64(0)
updateMemberShipCount := &vpcv1.InstanceGroupPatch{
MembershipCount: &zeroCount,
}
memberShipCountPatch, _ := updateMemberShipCount.AsPatch()
updateInstanceGroup.InstanceGroupPatch = memberShipCountPatch
_, res, err := service.UpdateInstanceGroup(updateInstanceGroup)
- 等待状态再次变为健康。
- 删除该组。
英文:
For instance group to be deleted the membership count should be updated to zero, then wait for the instance group status to be healthy again and then delete the group.
The steps would be :
- Check if instance group status is healthy, if not healthy then wait.
- If healthy, then update the membership count to zero
updateInstanceGroup := &vpcv1.UpdateInstanceGroupOptions{
ID: &id,
}
zeroCount := int64(0)
updateMemberShipCount := &vpcv1.InstanceGroupPatch{
MembershipCount: &zeroCount,
}
memberShipCountPatch, _ := updateMemberShipCount.AsPatch()
updateInstanceGroup.InstanceGroupPatch = memberShipCountPatch
_, res, err := service.UpdateInstanceGroup(updateInstanceGroup)
- wait for status to be healthy again
- delete the group
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论