# Updating the configuration of a VM does not change the VLAN ID

**URL:** https://forum.opennebula.io/t/updating-the-configuration-of-a-vm-does-not-change-the-vlan-id/3248
**Category:** Product Support
**Created:** [November 8, 2016, 7:58am UTC](https://forum.opennebula.io/t/updating-the-configuration-of-a-vm-does-not-change-the-vlan-id/3248 "2016-11-08T07:58:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![DaD](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/dad/32/8466_2.png) [@DaD](https://forum.opennebula.io/u/DaD)
#### Post date: [November 8, 2016, 7:58am UTC](https://forum.opennebula.io/t/updating-the-configuration-of-a-vm-does-not-change-the-vlan-id/3248/1 "2016-11-08T07:58:09Z")

</div>

Hello,

Today we had a network maintenance and I needed to change the VLAN ID of a network (the network was split in two parts and we were the unlucky ones who need to change it ;-)).

I thought that I’ll just need to change de network VLAN ID, shut-down the VMs, update their configuration and start the VMs.

This was working fine for the contextualisation parameters of the network, the network, netmask and gateway was updated correctly for the VMs.

Unfortunately, I did not manage to update the VLAN ID, even by setting the `ETH0_VLAN_ID`, either through Sunstone on CLI with `onevm updateconf`.

I don’t know if this is true for 5.2 so I did not open a ticket directly but should I?

---

<div class="post-metadata">

### Author: ![kepi](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/kepi/32/5560_2.png) [@kepi](https://forum.opennebula.io/u/kepi)
#### Post date: [August 28, 2022, 7:21pm UTC](https://forum.opennebula.io/t/updating-the-configuration-of-a-vm-does-not-change-the-vlan-id/3248/2 "2022-08-28T19:21:29Z")

</div>

This is really old _thread_, but I hit same problem and didn’t find any working solution. At same time, this post is high enough in search that there might be others with same issue.

From what I found out (I might be wrong):

- using `updateconf` (or in sunstone) you can update only context info
- context info is probably used only during new deploy (just guessing)
- if you need to change also actual NIC settings (IMHO always, not sure why there is no easy way), you can use `onedb change-body` or `onedb update-body`.

If you have only couple VMs, you can do this by hand, with something like:

```nohighlight
onedb change-body vm --id XXX "/VM/TEMPLATE/NIC[NIC_ID="0"]/VLAN_ID" 1234

```

As I had more VMs and my source of truth was current live setup, I ended up writing python script which takes info from `ovs-vsctl` about vlan tags on ports and update both context and NIC part for all NICs on all VMs.
