ystia / yorc

Ystia Orchestrator
https://ystia.github.io
Apache License 2.0
67 stars 23 forks source link

Inconsistent state when checking ssh connection (during a compute creation) fail or cancel #706

Open trihoangvo opened 3 years ago

trihoangvo commented 3 years ago

Bug Report

Description

When a4c sends a task "compute install" to yorc, yorc creates a VM and SSH to the VM for checking connection. However, when the VM is created successfully, but the checking connection is not finished (due to several reasons below), we have the following inconsistent state: On the cloud provider side, the VM is created. In the state machine, the VM is not created.

When users undeploy the application, the task "compute uninstall" is considered as successfully, the workflow continues to uninstall another dependent cloud resources (e.g., networks). However, the cloud provider cannot delete these resources since the VM is still there. As a result, the uninstall workflow never completes.

The SSH connection check may fail due to several reasons:

Expected behavior

The uninstall workflow deletes all resources and completes.

Actual behavior

The uninstall workflow considers the compute uninstall step as successful and does not delete the compute.

Steps to reproduce the issue

  1. Create a topology with one compute node, network node.
  2. Waiting until the compute is created on the cloud provider and is being booted.
  3. Click un-deploy.

Additional information you deem important (e.g. issue happens only occasionally)

Happen always

Output of yorc version

current develop

Priority

Medium.

A workaround is that users delete the VM on the cloud provider manually so that the undeployment process can complete.

Discussion

We may split the compute creation in two steps: compute create and compute start for a better error handling? This is useful for users to know that their VMs are created but failed to start. The terraform may remain the same, but we may set the state of the task to "created" / "started"?

trihoangvo commented 3 years ago

Hi @loicalbertin do you have any comments?