Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to reinstall Ubuntu Server running on VMWare VPS. The simplest way would certainly be to make a fresh install from mini ISO. But it's a production server and I can't afford an hour or more of downtime. Is it possible to reinstall with almost no downtime (say, 15 minutes or so)?

In other words, I'm looking for a way to upgrade OS release on live Ubuntu Server without noticeable downtime. I will transfer all settings and data manually.

Server facts:

  • Ubuntu Server 10.04.2 LTS amd64
  • VMWare VPS with console access (I can mount a local ISO image)
  • Single drive:
    • /boot, 92 MB on sda1 @ext4
    • /, 1.5 GB on LVM root @ext4
    • /srv, 19 GB on LVM data @ext4
    • swap on LVM swap

I have no experience with Linux file system tools (chroot and the like) yet. However, I guess a plan of action similar to the following might work (host is target VPS machine, upgrade is new OS):

  1. Install upgrade OS

    Install a fresh Ubuntu Server on local Virtual Box.

  2. Transfer services and settings

    Transfer services and settings from current OS to upgrade OS. I keep config as portable as possible and use etckeeper to track configuration changes.

  3. Copy upgrade OS file system to host

    I plan to use rsync to copy upgrade OS file system to host. But where to place it on host? I thought of:

    • a separate partition; I'd need to shrink LVM data on host and prepare new partition for the upgrade OS file system.

    • a file image; I'd create a file image on host's /srv partition, mount it on host (don't know how to yet) and copy upgrade OS file system into it.

    • a folder; I'd transfer mirror into folder on host's /srv partition. This would be the best option IMO, if at all possible.

  4. Replace current OS with upgrade OS file system

    I'm aware it depends on where the mirror has been transfered to. In any case it should be possible to switch first to test it working and replace file systems afterwards. I can afford to reboot and use recovery console or boot mini ISO for that.

Steps 3 and 4 are main question marks on which I need instructions. If you can advice changes to my 'plan' or a different approach, please, go ahead. Reference to instructions or documentation would be appreciated.

Edit: As suggested I'd go with a clone machine if I there's no other solution.

share|improve this question
    
No experience with Ubuntu Server, but all my OS upgrades on both Ubuntu Desktop and Debian were in-place, with no reformats required. If you have a working system, and just want to upgrade the OS, why not make a backup and do a normal upgrade (example instructions for 8.04-10.04 upgrade. No idea which versions you need)? –  Mike Renfro Jun 23 '11 at 13:09
    
@MikeRenfro I'm aware of dist upgrade in Ubuntu and been considering this. However, I prefer a clean environment, which only a new install can provide. –  kaimadag Jun 24 '11 at 9:24

1 Answer 1

I've no idea what your commercial relationship is with your VPS provider but if this were my VMWare environment I'd simply clone the current production VM, bring the clone up with an adjacent IP address, apply changes/updates, move over anything that's changed from the production since the cloning, test the updated clone then when happy switch over the IPs and eventually kill the original VM.

share|improve this answer
    
Yes, that's definitely the simplest and most efficient method to upgrade or reinstall. The only drawback is the extra machine has to payed for, while I'm payed already. Thus I'm looking for a method to reinstall in-place. I can't vote yet, but I'd give +1 if I could. –  kaimadag Jun 24 '11 at 9:21
    
There's another drawback I can think of. This method relays on VMWare and can't be applied to dedicated server (may be expensive) or other virtualization platforms, which don't support cloning. –  kaimadag Jun 24 '11 at 9:33
    
I know the whole 'paid for' bit but the price paid for another VPS/VM for the week or two required will be worth it if it means a quick and safe upgrade. Oh and all other virtualised platforms DO support cloning, but you're right that it doesn't really work for physicals but then the OP said it was a VPS. –  Chopper3 Jun 24 '11 at 10:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.