weixin_39725594 2020-11-29 13:32
浏览 0

All cloud instances.

Description of change

Each provider has to implement an InstanceBroker interface. One of the major calls of this interface is AllInstances(). The call is made whenever Juju needs to retrieve known cloud instances, be it for provisioning, for adopting resources, for querying instance states, destroying instances, etc.

The original intent was to always list all instances. However, it became apparent that some providers had limitations on what a user can do with an instance in a particular state, so the AllInstance method was inconsistently re-defined to mean all running, usable instances. This especially affected public clouds like aws. This new definition works for most of cases, except for destroying an instance - Juju does not really care what state the instance is in as long as we knew about and at the time when we want to terminate, we can. In addition, some providers did not need to make this distinction either because their underlying substrate only returned running instances or because the substrate dealt with instances in different state itself.

This means that we needed to rename current AllInstances to mean AllRunnningInstances and re-implement new AllInstances to return all instances except the ones that are already terminated. This PR does just that.

This is a largely mechanical PR. Most of fun is in environ broker where a new AllRunningInstances call is added and in providers that filter on status like ec2 and gce.

该提问来源于开源项目:juju/juju

  • 写回答

5条回答 默认 最新

  • weixin_39725594 2020-11-29 13:32
    关注
    评论

报告相同问题?