删除 IBM Cloud VPC 中 InstanceGroup 的依赖关系的算法是什么?

huangapple go评论79阅读模式
英文:

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

例如,要删除实例组,必须将成员计数更新为零,然后等待实例组状态再次变为健康,然后删除该组。

步骤如下:

  1. 检查实例组状态是否健康,如果不健康,则等待。
  2. 如果健康,则将成员计数更新为零。
    updateInstanceGroup := &vpcv1.UpdateInstanceGroupOptions{
        ID: &id,
    }
    zeroCount := int64(0)
    updateMemberShipCount := &vpcv1.InstanceGroupPatch{
        MembershipCount: &zeroCount,
    }
    memberShipCountPatch, _ := updateMemberShipCount.AsPatch()
    updateInstanceGroup.InstanceGroupPatch = memberShipCountPatch
    _, res, err := service.UpdateInstanceGroup(updateInstanceGroup)
  1. 等待状态再次变为健康。
  2. 删除该组。
英文:

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 :

  1. Check if instance group status is healthy, if not healthy then wait.
  2. 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)
  1. wait for status to be healthy again
  2. delete the group

huangapple
  • 本文由 发表于 2022年1月4日 02:12:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/70569827.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定