You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
virt/docs/GO_AGENT_DOMAIN_DELETE.md

1.7 KiB

Go Agent domain_delete contract

This slice implements a narrow, identity-bound libvirt definition undefine operation. It is not the panel's full VM deletion workflow.

Host boundary

  • The request payload is exactly { "uuid": "<canonical UUID>" }.
  • InspectDomainForDeletion performs a targeted read-only dumpxml --inactive and domstate observation. It does not enumerate domains or touch storage, networking, firewall state, or seed artifacts.
  • DeleteDomain refuses an active domain. It invokes only virsh undefine --domain <canonical UUID> and then requires a targeted absence read-back before returning success.
  • Fake and virsh backends report only a SHA-256 XML digest; raw XML and host paths never enter the operation result or journal.
  • storage_removed=false and network_changed=false are explicit result facts. The operation never deletes disks or changes a network.

If the undefine command or absence read-back is ambiguous, the operation is uncertain. Reconciliation calls only InspectDomainForDeletion; it never replays undefine. A present definition, failed transport, or missing state read-back therefore cannot become a false success.

PHP boundary

The Go API accepts domain_delete, but the PHP CloudAgentVmGateway keeps the legacy panel delete mapping disabled (null). The existing panel operation also owns disk/seed cleanup, billing state, firewall history, and irreversible instance tombstoning. Mapping it to definition-only undefine would report a successful VM deletion while leaving those resources behind. A future mapping requires a separate typed storage/seed/network cleanup contract, panel CAS updates, and real-host read-back evidence.