Unable to clone virtual server ("no IPv4 allocation ranges have been configured")

So, I'm trying to clone a virtual server to create a new dev site and I'm thinking this is a perfect time to use the clone tool. I'm getting these errors:

$ virtualmin clone-domain --domain www.example.com --newdomain dev.example.com --newuser example.dev --newpass password
Cloning virtual server www.example.com to dev.example.com with username example.dev ..
Creating new virtual server settings ..
.. done

Allocating new IPv4 address ..
.. no IPv4 allocation ranges have been configured

.. cloning failed!

This happens whether the virtual server has SSL enabled or not. I added a couple IPv4 addresses that are allocated to my server to the default templates and the clone tool reported that it still couldn't find a free IP address. Do you have any ideas?

Status: 
Closed (fixed)

Comments

If the domain being cloned has a private IP address, Virtualmin will need to allocate a new one for the clone. This means that you have to setup an IP allocation range, at System Settings -> Server Templates -> Default Settings -> Virtual IP Address.

That makes sense. This virtual server has an external IP, though, and that's the range that I put in the template virtual IP address settings.

Have you upgraded to Virtualmin 3.89 yet? I seem to recall I fixed a bug in this area that was in the 3.88 release ..

I'm using 3.89.

When I add an IP range in the "Virtual IP Addresses" part in Server Templates, I get this:

Cloning virtual server www.example.com to dev.example.com with username example.dev ..
Creating new virtual server settings ..
.. done
Allocating new IPv4 address ..
.. no free IPv4 address was found

.. cloning failed!

I think it would make more sense to allow the setting of an IP address directly from the "Clone Virtual Server" form.

That error means that Virtualmin thinks that every IP in the range is in use by a domain or pingable..

What would be ideal, I think, is to be able to enter the new IP address when cloning a virtual server (similar to how a new IP address can be entered when creating a new virtual server or sub-server). Choosing which features are getting cloned would be very useful, too.

As it is now, I have several free IP addresses that are in /etc/network/interfaces but aren't used by Virtualmin for any virtual servers. Virtualmin still gives me the error:

Allocating new IPv4 address ..
.. no IPv4 allocation ranges have been configured

Is there another place to enter this information in advance? As noted in #4, I do see a "Virtual IP address" section in Server Templates, but manually entering the available IP ranges there is not working as expected.

You should remove the IPs from /etc/network/interfaces , or else Virtualmin will think they are in use - then automatic IP allocation should work.

Another option is to revert the source domain to a shared IP address, clone it, and then assign the specific IP that you want to the clone.

Right, all the IP addresses that I have are already in /etc/network/interfaces so that they're available when I manually create new virtual servers.

Another option is to revert the source domain to a shared IP address, clone it, and then assign the specific IP that you want to the clone.

Would it be possible to add this to the existing form and workflow?

Sure .. I will look into adding this for the next Virtualmin release.

This has been implemented, for inclusion in Virtualmin 3.91.

Automatically closed -- issue fixed for 2 weeks with no activity.