Extending virtualmin VM by second VM?

Currently I’m running my first webin/virtualmin instance on a fairly small VM that can not be expanded anymore. It took a long time to get this virtualmin setup working and especially e-mailing. I would hate to go through the whole setup again on another VM. So…if my customer base grows and I’m forced to create a second VM (with it’s own public ip) would I somehow be able to use that as ‘an extension’ of my first server? I’m probably going to use WHMCS for automatic registration and sign up.

I guess I’m wondering if one Webmin instance can manage and control several virtualmin servers or so?

Look at webmin clustering… you need to setup the webmin servers index first, that will allow you to control both from one place, however you may want to leave the mail server where it is and move other services to the second server. I have done this once but it’s not for the feint hearted keeping everything in sync, however that was a decade ago so things may have changed by now

1 Like

It is not easy to extend Virtualmin in the manner that you have described. That is to say that there are no built in options in Virtualmin to, for example, extend storage with just one click. Your idea of extending Virtualmin by getting one instance to control another is possible, as @jimr1 has confirmed, but even if you use Webmin clustering for this, the new Virtualmin server will not inherit the Virtualmin setup from the old server - you will have to setup and configure the new server by applying the same effort that you had put into getting the old server setup the way you like it to be.

An alternate strategy that you could consider is to:

  1. create an image or snapshot of the old server
  2. store the image or snapshot somewhere on the cloud
  3. upgrade the old server with more storage, ram and cores as required - ideally this can be done and you get to retain old IP address, on most vps service providers
  4. restore the image or snapshot on the upgraded machine.

If the IP address and OS is the same, the restore of the image / snapshot should work without any reconfiguration. You will have a Virtualmin system with expanded storage and resources but with all your preferred settings carried over from the old server to the new / upgraded server.

This sort of thing could also be termed ‘extending’ but it is different from what you imagined it to be.

1 Like

Is this on a VPS or is the a physically machine. VPS normally have way to increase storage.
Like I use vultr

1 Like

Thank you all, really useful!

@stefan1959 It’s a VPS on a decentralised node. I guess the way these are built you simply can’t eassily extend it…although long time ago I managed to use terraform to install the VM and a volume group and than later extend the volume group. It worked, but not easy.

I’m going to give that a try @calport , Thanks! :pray:

I tried this once at AWS and it didn’t recognize the increased space. :frowning: I probably could have figured it out but, at that point, it wasn’t worth the effort.

That doesn’t cover any Virtualmin features.

You need to extend the filesystem when you expand a partition.

My fuzzy recollection is the original image wasn’t LVM. If it were a local machine I’d have booted a Gparted rescue disk. It was only a DNS server and I wanted to upgrade to play with Discourse but didn’t want to do it on my main server yet.

I really just wanted to point out that the above advice may not be as easy as stated depending on, well, stuff. When I put a snapshot on a new machine I saw no easy path to get the new disk space recognized.

Doesn’t matter if it’s LVM (I mean, it does, but that’s a layer below the filesystem). If your filesystem is on a volume (LVM) you may need to expand the partition, physical volume, and logical volume, and the the filesystem. If the filesystem is directly on a partition (or some magic partition the hosting provider offers you on their block storage, whatever that might be), you have to expand the filesystem. e.g. resize2fs is it’s an ext4 filesystem.

If this was in the Webmin interface, I missed it. I might be wrong but the volume can’t be mounted when you do a resize2fs? Or probably at least pops up a warning?

I’m not doubting that it can be done. This is merely a caveat to @calport
's advice that just putting an image on a machine with more storage doesn’t mean you will automatically see that space. If you had LVM on the original, painless fix. If not, a tad more complicated. But my experience was, it isn’t as automatic as the post makes it sound.

1 Like

It can’t be done in webmin, like my link to the vultr docs say you need to boot on a rescue disk, or are you talking about something else.
Just googled aws and seem like a less downtime (if any) prossess

So if your main disk is before your lvm partition you need to add the host disk . Meaning the new space has been added to sda1 your lvm volume resides on sda2, you need to just move the free space from sda1 to sda2 then extend the logical volume on sda2. I must admit I could not find away in the webmin gui to re allocate the space but once the space is available to the lv’s home mount it is dead easy using webmin to add the new free space to the logical volume

The only method left on this VM for me was to tar the root filesystem (snapshots not supported by this OS at the moment), back it up and install it on a new vm. That didn’t work, it never came back up. Likely partly due to another IP among other things. But I do not want to destroy the current vm until i have a rock solid way.

Basically what I need is a way to completely backup the current webmin/virtualmin installation including it’s settings and the 3 websites runnign on it, destroy this vm, create a new one with the same IP, likely reinstalling virtualmin and copy back the backup.

Is there a method to easily do this?

I assume I could try this: How to Migrate to a New Server | Virtualmin — Open Source Web Hosting Control Panel

But prefferably download it to my local pc, destroy te current vm and create a new one to keep the IP address, since I run a NS server on virtualmin as well…I’m afraid a nw VM and new IP may messes up all my attempts to get NS and mail-servers running well…

Plus…does the above migration method copy all webmin and virtualmin settings? For mailservers, templates etc.?

Virtualmin can change all the IPs for you. I wouldn’t consider that an argument for destroying the old server before bringing up the new. Rather, I’d argue you should bring up a new VM, leave the old one running, and migrate one domain at a time…starting with the least important one first, so you can work out all the kinks with the migration process and get comfortable with it.

Thank you @Joe . May I asume that virtualmin.tar.gz holds all settings outside of the domains/hosting?

I assume that your VM is in a data center, and you wish to backup all the virtualmin data, reprovision the VM and restore the the virtualmin data back to the newly provisioned VM ?
If do I have done this loads of times, with no problems, by the following

  1. Use Virtualmin BackUp and backup all domains making sure the the arrowed item is as the screen shot suggests
  2. After you successfully downloaded and tested the integrity of the downloaded backups, reprovision the VM with the OS of choice
  3. Install Virtualmin using the automated script
  4. Using the freshly installed virtualmin restore your backups, this will recreate the domains,users and dns records

You should be good to go
potential gotcha ya’s

  1. I made the mistake of taking too long to restore once which overran the TTL of the DNS records, so the name servers did not resolve, work around for that was to move the dns for the domain that has the nameservers A records (e.g ns.mydomain.com & ns2.mydomain.com) back to my suppliers nameservers and disabled the dns option in virtualmin for that domain, which then allowed the A records for my name servers to resolve. I never got around to switching it back and I guess it’s fail safe in the respect that the nameservers will always resolve.
  2. If you have installed any extra utilities on the original VM they will be lost e.g you may have installed ‘midnight commander’ which you will have to manually reinstall

That’s the only gotcha’s I remember

Just in time @jimr1 ! I was getting ready to give it a try tomorrow by using the instructions at How to Migrate to a New Server | Virtualmin — Open Source Web Hosting Control Panel

But yours sounds even easier. I assume I can still use the advise in the link to lower the TTL first and later bring it back on the new VM.

One question left; indeed its running on a vm in a datacenter. When I create a new vm it gets another IP address obivously. If I understand correctly also from Joe, this should cause no problems?

The reason I ask; I use one of the 3 domain names in virtualmin as nameservers. At namecheap these ns1 and ns2 point to the IP address of this virtualmin VM. So, I’ll definately will have to change those over to the new IP at namecheap.

The way these vm’s work is; when deleting the current one and recreate a new one quickly, it will get the same IP address and I won’t run into any IP issues.

But obviously this takes away the security of being able to go back the the original one when sh*t hits the fan.

Sofar seems it’s not 100% correct, DNS messes up:

I guess I’ll try and edit them manually, fortunately just a few domains

Never had that but is 10.x.x.x a local address and not a public one ?