def launch_instances(self, ctx, cluster, target_count): # create all instances cluster = conductor.cluster_update(ctx, cluster, {"status": self.STAGES[0]}) LOG.info(g.format_cluster_status(cluster)) tmpl = heat.ClusterTemplate(cluster) self._configure_template(ctx, tmpl, cluster, target_count) stack = tmpl.instantiate(update_existing=self.UPDATE_STACK) stack.wait_till_active() self.inst_ids = self._populate_cluster(ctx, cluster, stack) # wait for all instances are up and networks ready cluster = conductor.cluster_update(ctx, cluster, {"status": self.STAGES[1]}) LOG.info(g.format_cluster_status(cluster)) instances = g.get_instances(cluster, self.inst_ids) self._await_networks(cluster, instances) if not g.check_cluster_exists(cluster): LOG.info(g.format_cluster_deleted_message(cluster)) return # prepare all instances cluster = conductor.cluster_update(ctx, cluster, {"status": self.STAGES[2]}) LOG.info(g.format_cluster_status(cluster)) instances = g.get_instances(cluster, self.inst_ids) volumes.mount_to_instances(instances) self._configure_instances(cluster)
def _launch_instances(self, cluster, target_count, stages, update_stack=False, disable_rollback=True): # create all instances cluster = c_u.change_cluster_status(cluster, stages[0]) inst_ids = self._create_instances(cluster, target_count, update_stack, disable_rollback) # wait for all instances are up and networks ready cluster = c_u.change_cluster_status(cluster, stages[1]) instances = c_u.get_instances(cluster, inst_ids) self._await_networks(cluster, instances) # prepare all instances cluster = c_u.change_cluster_status(cluster, stages[2]) instances = c_u.get_instances(cluster, inst_ids) volumes.mount_to_instances(instances) self._configure_instances(cluster) return inst_ids
def _launch_instances(self, cluster, target_count, stages, update_stack=False, disable_rollback=True, instances_to_delete=None): # create all instances cluster = c_u.change_cluster_status(cluster, stages[0]) inst_ids = self._create_instances( cluster, target_count, update_stack, disable_rollback, instances_to_delete) # wait for all instances are up and networks ready cluster = c_u.change_cluster_status(cluster, stages[1]) instances = c_u.get_instances(cluster, inst_ids) self._await_networks(cluster, instances) # prepare all instances cluster = c_u.change_cluster_status(cluster, stages[2]) instances = c_u.get_instances(cluster, inst_ids) volumes.mount_to_instances(instances) self._configure_instances(cluster) return inst_ids
def launch_instances(self, cluster, target_count): # create all instances cluster = g.change_cluster_status(cluster, self.STAGES[0]) tmpl = heat.ClusterTemplate(cluster) self._configure_template(tmpl, cluster, target_count) stack = tmpl.instantiate(update_existing=self.UPDATE_STACK, disable_rollback=self.DISABLE_ROLLBACK) heat.wait_stack_completion(stack.heat_stack) self.inst_ids = self._populate_cluster(cluster, stack) # wait for all instances are up and networks ready cluster = g.change_cluster_status(cluster, self.STAGES[1]) instances = g.get_instances(cluster, self.inst_ids) self._await_networks(cluster, instances) # prepare all instances cluster = g.change_cluster_status(cluster, self.STAGES[2]) instances = g.get_instances(cluster, self.inst_ids) volumes.mount_to_instances(instances) self._configure_instances(cluster)
def launch_instances(self, ctx, cluster, target_count): # create all instances cluster = conductor.cluster_update(ctx, cluster, {"status": self.STAGES[0]}) LOG.info(g.format_cluster_status(cluster)) tmpl = heat.ClusterTemplate(cluster) self._configure_template(ctx, tmpl, cluster, target_count) stack = tmpl.instantiate(update_existing=self.UPDATE_STACK) stack.wait_till_active() self.inst_ids = self._populate_cluster(ctx, cluster, stack) # wait for all instances are up and networks ready cluster = conductor.cluster_update(ctx, cluster, {"status": self.STAGES[1]}) LOG.info(g.format_cluster_status(cluster)) instances = g.get_instances(cluster, self.inst_ids) self._await_networks(cluster, instances) # prepare all instances cluster = conductor.cluster_update(ctx, cluster, {"status": self.STAGES[2]}) LOG.info(g.format_cluster_status(cluster)) instances = g.get_instances(cluster, self.inst_ids) volumes.mount_to_instances(instances) self._configure_instances(cluster)
def launch_instances(self, cluster, target_count): # create all instances cluster = g.change_cluster_status(cluster, self.STAGES[0]) self.create_instances(cluster, target_count) # wait for all instances are up and networks ready cluster = g.change_cluster_status(cluster, self.STAGES[1]) instances = g.get_instances(cluster, self.inst_ids) self._await_networks(cluster, instances) # prepare all instances cluster = g.change_cluster_status(cluster, self.STAGES[2]) instances = g.get_instances(cluster, self.inst_ids) volumes.mount_to_instances(instances) self._configure_instances(cluster)
def launch_instances(self, cluster, target_count): # create all instances cluster = g.change_cluster_status(cluster, self.STAGES[0]) cpo.add_provisioning_step(cluster.id, _("Create Heat stack"), 1) with context.InstanceInfoManager([cluster.id, None, None, None]): self.create_instances(cluster, target_count) # wait for all instances are up and networks ready cluster = g.change_cluster_status(cluster, self.STAGES[1]) instances = g.get_instances(cluster, self.inst_ids) self._await_networks(cluster, instances) # prepare all instances cluster = g.change_cluster_status(cluster, self.STAGES[2]) instances = g.get_instances(cluster, self.inst_ids) volumes.mount_to_instances(instances) self._configure_instances(cluster)