yandex-qatools/teamcity-openstack-plugin

Improve VMs status ping

Closed this issue · 1 comments

Currently, all created VMs are ping every 3 seconds:

this.executor.scheduleWithFixedDelay(new VerboseRunnable(() -> {
for (OpenstackCloudInstance instance : getInstances()) {
instance.updateStatus();
if (instance.getStatus() == InstanceStatus.STOPPED || instance.getStatus() == InstanceStatus.ERROR) {
forgetInstance(instance);
}
}
}, true), 3, 3, TimeUnit.SECONDS);

This behavior occurs many call to OpenStack API, and logs in platform ; not minor when you have many many many VMs managed by this plugin.

It could be great to reduce this number of call, possible way:

  • Increade time call
  • Use an OpenStack API endpoint (if exist) which give status for all VMs ; FYI AWS plugin seems use that, every minute

Using

for (Server s : openstackApi.getNovaServerApi().listInDetail().concat()) {
    System.out.println("DEBUG: " + s.getName() + " = " + s.getStatus());
}

produces only one GET:

GET https://openstack.company.com/v2.1/ec...43/servers/detail

=> Seems achievable