# Error detaching VM NIC: Could not detach NIC

**URL:** <https://forum.opennebula.io/t/error-detaching-vm-nic-could-not-detach-nic/7023>\
**Category:** Installation & Configuration\
**Created:** [March 13, 2019, 4:36pm UTC](https://forum.opennebula.io/t/error-detaching-vm-nic-could-not-detach-nic/7023 "2019-03-13T16:36:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gray380](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@gray380](https://forum.opennebula.io/u/gray380)\
**Post date:** [March 13, 2019, 4:36pm UTC](https://forum.opennebula.io/t/error-detaching-vm-nic-could-not-detach-nic/7023/1 "2019-03-13T16:36:19Z")

</div>

Hi,

I can attach NIC to VM (kvm) on the fly, but when I try to detach it the following error messages are appeared:

```
Wed Mar 13 18:14:45 2019 [Z0][VMM][I]: Command execution fail: cat &lt;&lt; EOT | /var/tmp/one/vmm/kvm/detach_nic 'one-5' '02:00:ac:80:0e:14' 5 one-kvm-node-01-int
Wed Mar 13 18:14:45 2019 [Z0][VMM][E]: Could not detach NIC (02:00:ac:80:0e:14) from one-5
Wed Mar 13 18:14:45 2019 [Z0][VMM][I]: ExitCode: 255
Wed Mar 13 18:14:45 2019 [Z0][VMM][I]: Failed to execute virtualization driver operation: detach_nic.
Wed Mar 13 18:14:45 2019 [Z0][VMM][E]: Error detaching VM NIC: Could not detach NIC (02:00:ac:80:0e:14) from one-5

```

Node is a KVM host on the CentOS 7.  
VN\_MAD : bridge  
The VM has been created from the ’ ttylinux - kvm ’ template.  
Also I have issues with powering off the VM:  
Poweroff:

> Thu Mar 14 09:54:26 2019 [Z0][VMM][I]: Command execution fail: cat \<\< EOT | /var/tmp/one/vmm/kvm/shutdown ‘one-6’ ‘one-kvm-node-01-int’ 6 one-kvm-node-01-int  
> Thu Mar 14 09:54:26 2019 [Z0][VMM][E]: Timed out shutting down one-6  
> Thu Mar 14 09:54:26 2019 [Z0][VMM][I]: ExitCode: 255  
> Thu Mar 14 09:54:26 2019 [Z0][VMM][I]: Failed to execute virtualization driver operation: shutdown.  
> Thu Mar 14 09:54:26 2019 [Z0][VMM][E]: Error shutting down VM: Timed out shutting down one-6

Poweroff hard:

> Thu Mar 14 10:05:41 2019 [Z0][VM][I]: New LCM state is SHUTDOWN\_POWEROFF  
> Thu Mar 14 10:05:41 2019 [Z0][VMM][I]: ExitCode: 0  
> Thu Mar 14 10:05:41 2019 [Z0][VMM][I]: Successfully execute virtualization driver operation: cancel.

VM stuck in the LCM State SHUTDOWN\_POWEROFF.

Could you help to solve these issues?

brg,  
Serhiy.

---

<div class="post-metadata">

**Author:** ![gray380](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@gray380](https://forum.opennebula.io/u/gray380)\
**Post date:** [March 14, 2019, 9:23am UTC](https://forum.opennebula.io/t/error-detaching-vm-nic-could-not-detach-nic/7023/2 "2019-03-14T09:23:16Z")

</div>

Okay, I’ve solved ‘poweroff -h’ issue with Recover → Success.  
And NIC has been successfully removed within VM STATE : POWEROFF

> Thu Mar 14 10:25:45 2019 [Z0][VM][I]: New state is POWEROFF  
> Thu Mar 14 10:25:45 2019 [Z0][VM][I]: New LCM state is LCM\_INIT  
> Thu Mar 14 10:29:50 2019 [Z0][DiM][I]: VM NIC Successfully detached.

So this means that I can not detach NIC on the fly, is it correct?
