Skip to main content

Detach Network Interface from VM

DELETE/v2.1/{project_id}/servers/{server_id}/os-interface/{port_id}

Detaches a network interface from a VM. By default the port is deleted with the interface; keep that in mind if a floating IP or a security group is bound to the port.

info

Request​

Parameters​

project_idstringrequired

The UUID of the project.

server_idstringrequired

The UUID of the VM.

port_idstringrequired

The ID of the port to detach. Get it from List VM Network Interfaces.

Sample Request​

curl -ks -X DELETE -H 'Content-Type: application/json' -H 'X-OpenStack-Nova-API-Version: 2.67' \
-H 'X-Auth-Token: gAAAAA<...>' \
https://api.vietnix.cloud:8774/v2.1/{project_id}/servers/{server_id}/os-interface/{port_id}

Response​

Status Code​

Success​

Status CodeDescription
202 - AcceptedThe detach was accepted and is being processed.

Error​

Status CodeDescription
401 - UnauthorizedUser must authenticate before making a request.
403 - ForbiddenPolicy does not allow current user to do this operation.
404 - Not FoundThe VM or the port does not exist, or the port is not attached to this VM.
409 - ConflictThe VM is in a status that does not allow detaching.
501 - Not ImplementedNetwork interfaces are not implemented for this deployment.
warning

Detaching the only interface of a VM cuts all of its network access, including SSH and the floating IP association. Make sure you still have console access before you do it.