OPNsense Forum

Archive => 18.7 Legacy Series => Topic started by: Serius on October 16, 2018, 10:56:08 am

Title: Migration to VM
Post by: Serius on October 16, 2018, 10:56:08 am
I've been using opnsense in a dedicated box with two nics and multiple interface for vlans.
Now I'm trying to migrate to my esxi box. I created the VM with two nics for the moment, in the wan tagged group and in the management one. I installed it, updated, and after restoring the backup from the phys, it messes the esxi network. Not only the internal but even the machine ipmi. The rest of the network is ok.

So the question is, when doing such migration, how do you raise the opns VM services for the first time? and do you configure it the same as the physical one (ops, DHCP...)?
If I want to leave the physical as service backup, would leave it as an exact copy? Wouldn't then collide?
Thanks for your help.
Title: Re: Migration to VM
Post by: bartjsmit on October 16, 2018, 12:36:51 pm
Remove the VLAN interfaces. Backup the config on the physical through the web interface, build a new VM from the iso, restore the config, and set the interfaces through the VM console.

Add the VLAN's as port groups on your virtual switch and  add them as vNIC's to the VM.

The VM vNIC properties will give you the MAC addresses, invaluable in telling them apart.

Bart...
Title: Re: Migration to VM
Post by: Serius on October 16, 2018, 06:41:05 pm
Thanks Bart for your help. You say remove vlans previously in the bare metal as means of leaving only the basic wan/lan interfaces and thus converting it into tagged groups in esxi, right?

But during the implementation I leave the bare metal online?
And I create first only two vnics?

Enviado desde mi MI 5s Plus mediante Tapatalk

Title: Re: Migration to VM
Post by: bartjsmit on October 16, 2018, 11:06:16 pm
Yes, indeed. I would follow these steps:

1. Back up the current configuration *with* the VLAN interfaces. That will give you a roll back option.
2. Remove the VLAN interfaces and back up again as the migration configuration.
3. Create an OPNsense VM and import the migration configuration.
4. Set the LAN and WAN interfaces in the OPNsense console and test the basic firewall configuration
5. Create as many ESXi port groups as you have VLAN's, and tag them accordingly
6. Reboot the VM and configure the new interfaces

I would switch off the old OPNsense computer after the second backup. That way you can re-use the IP addresses and you won't have to change any settings on the rest of your network.

Bart...
Title: Re: Migration to VM
Post by: Serius on October 16, 2018, 11:29:14 pm
Thanks again Bart.
Unfortunately making any change in vlans rendered my network useless. Due to the configuration of the l3 switch. So I finally made something like your last approach, but instead of removing the vlans, I edited the configuration XML and created a custom one for the transition deactivating the secondary interfaces and changing nic assignments for the main ones. Now I have an accessable GUI and I have to adapt the rest of the interfaces.

Would also be possible to set up the physical one as an ha backup?

Enviado desde mi MI 5s Plus mediante Tapatalk
Title: Re: Migration to VM
Post by: bartjsmit on October 17, 2018, 08:25:12 am
Well done!

In theory yes, but the difference in configuration is going to make CARP tricky. I prefer VMware HA but that needs at least two ESXi hosts and a vSphere licence.

Bart...
Title: Re: Migration to VM
Post by: Serius on October 17, 2018, 09:02:11 am
That was just what I was thinking on. Thank you very much Bart.

Enviado desde mi MI 5s Plus mediante Tapatalk