def _provision_nodes(id, node_group_id_map): ctx = context.ctx() cluster = conductor.cluster_get(ctx, id) plugin = plugin_base.PLUGINS.get_plugin(cluster.plugin_name) cluster = conductor.cluster_update(ctx, cluster, {"status": "Scaling"}) LOG.info(g.format_cluster_status(cluster)) instances = i.scale_cluster(cluster, node_group_id_map, plugin) if instances: cluster = conductor.cluster_update(ctx, cluster, {"status": "Configuring"}) LOG.info(g.format_cluster_status(cluster)) try: plugin.scale_cluster(cluster, i.get_instances(cluster, instances)) except Exception as ex: LOG.exception("Can't scale cluster '%s' (reason: %s)", cluster.name, ex) conductor.cluster_update(ctx, cluster, {"status": "Error"}) LOG.info(g.format_cluster_status(cluster)) return # cluster is now up and ready cluster = conductor.cluster_update(ctx, cluster, {"status": "Active"}) LOG.info(g.format_cluster_status(cluster))
def _provision_nodes(cluster_id, node_group_names_map): cluster = get_cluster(id=cluster_id) plugin = plugin_base.PLUGINS.get_plugin(cluster.plugin_name) context.model_update(cluster, status="Scaling") instances = i.scale_cluster(cluster, node_group_names_map, plugin) if instances: context.model_update(cluster, status="Configuring") plugin.scale_cluster(cluster, instances) # cluster is now up and ready context.model_update(cluster, status="Active")
def _provision_nodes(id, node_group_id_map): ctx = context.ctx() cluster = conductor.cluster_get(ctx, id) plugin = plugin_base.PLUGINS.get_plugin(cluster.plugin_name) cluster = conductor.cluster_update(ctx, cluster, {"status": "Scaling"}) LOG.info(g.format_cluster_status(cluster)) instances = i.scale_cluster(cluster, node_group_id_map, plugin) if instances: cluster = conductor.cluster_update(ctx, cluster, {"status": "Configuring"}) LOG.info(g.format_cluster_status(cluster)) plugin.scale_cluster(cluster, i.get_instances(cluster, instances)) # cluster is now up and ready cluster = conductor.cluster_update(ctx, cluster, {"status": "Active"}) LOG.info(g.format_cluster_status(cluster))