Using the self-serve net installer
For some guest operating systems it is possible for customers to launch a self-service network installer from the Xen Shell.
Default image installs vs. network installer
Most BitFolk customers have their VPS initially provisioned by BitFolk support via an image file. This results in a minimal install fully-customised for the BitFolk environment, but with very little flexibility.
Some customers prefer to run through their chosen operating system's familiar network installer in order to carry out a custom install to their specification. This can also be useful to reinstall your VPS without requiring assistance from BitFolk support.
Not all operating systems that BitFolk supports are available as self-service network installs. It requires that the operating system has a Xen-compatible network installer, and that this has been tested by BitFolk.
Prerequisites
In order to initiate a network install you must:
- Have access to your Xen Shell.
- If you don't know the password then you'll need to do a reset or contact BitFolk Support.
- Be prepared to nuke your existing VPS and any data stored on it.
- Generally the first thing the network installers do is format your VPS's block device(s), so don't try to do this unless you have backups or don't care about your data. It might be possible depending on the installer to preserve the contents of some block devices, but please don't rely on this.
Initiating a network install
Use the install command. It's as simple as:
xen-shell v1.48bitfolk2 - type 'help' for help.
xen-shell> install debian_lenny
About to overwrite your VPS with the debian_lenny network installer - this will result in a loss of all data, without further confirmation!
Are you sure? Please type "Yes" to confirm, or anything else to abort.
INSTALL?> yes
Booting debian_lenny net installer for: debtest1
Using config file "/etc/xen/debtest1.conf".
Install Mirror: http://ftp.uk.debian.org/debian
Install Suite: lenny
Installer: http://ftp.uk.debian.org/debian/dists/lenny/main/installer-i386/current/images
WARNING: Installer kernel and ramdisk are not authenticated.
Fetching http://ftp.uk.debian.org/debian/dists/lenny/main/installer-i386/current/images/netboot/xen/vmlinuz
Fetching http://ftp.uk.debian.org/debian/dists/lenny/main/installer-i386/current/images/netboot/xen/initrd.gzThe network installer should then boot and you'll follow the usual procedure for installing your chosen operating system.
OS-specific notes
Debian
The installation process is pretty much identical to a normal Debian net install, with the following quirks.
Disk partitioning
On a normal machine you would usually have a block device such as /dev/sda representing an entire hard disk, and you would then partition this into one or more partitions like /dev/sda1, /dev/sda2, etc. On a BitFolk VPS you have /dev/xvda (and perhaps additional block devices if you have requested that), but later resizing of these block devices is made much easier if you place a filesystem directly on the block device without a partition table.
Additionally, the first block device (/dev/xvda) must contain your root filesystem and /boot and must be of type ext3.
Unfortunately the partman partitioning tool doesn't like putting filesystems directly onto block devices. The first partman dialog you'll be shown looks like this:
┌────────────────────────┤ [!!] Partition disks ├─────────────────┐ │ │ │ The installer can guide you through partitioning a disk (using │ │ different standard schemes) or, if you prefer, you can do it │ │ manually. With guided partitioning you will still have a chance later │ │ to review and customise the results. │ │ │ │ If you choose guided partitioning for an entire disk, you will next │ │ be asked which disk should be used. │ │ │ │ Partitioning method: │ │ │ │ Guided - use entire disk │ │ Guided - use entire disk and set up LVM │ │ Guided - use entire disk and set up encrypted LVM │ │ Manual │ │ │ │ <Go Back> │ │ │ └─────────────────────────────────────────────────────────────┘
The rest of this section covers the usual case where BitFolk has given you a single block device upon which you intend to put your root filesystem. If instead you have additional block devices and want to do something more advanced then the procedure is slightly more complicated.
You'll need to select Manual. Then you'll see something like:
┌────────────────┤ [!!] Partition disks ├─────────────────────────┐ │ │ │ This is an overview of your currently configured partitions and mount │ │ points. Select a partition to modify its settings (file system, mount │ │ point, etc.), a free space to create partitions, or a device to │ │ initialize its partition table. │ │ │ │ Guided partitioning │ │ Help on partitioning │ │ │ │ Virtual disk 1 (xvda) - 10.7 GB Xen Virtual Block Device │ │ > #1 10.7 GB ext3 │ │ │ │ Undo changes to partitions │ │ Finish partitioning and write changes to disk │ │ │ │ <Go Back> │ │ │ └─────────────────────────────────────────────────────────────┘
You are advised to move to the line for the single existing filesystem:
│ > #1 10.7 GB ext3 │
select it, then:
- Use as: Ext3 journaling file system
- Format the partition: yes, format it
- Mount point: /
"relatime" is a good idea as a mount option, and using a filesystem label is also smart.
It is recommended not to add a swap partition. The installer later creates a swap file for you.
If you decide not to follow this advice and start adding partitions then it should still work, but if you later request your block device be resized it will require longer downtime, and your VPS would be booting in a way that is different to all other BitFolk VPSes, so it is not recommended. If you want extra disk devices then just contact support; this will not be a problem.
Once you've selected Finish partitioning and write changes to disk the installation will proceed as normal. If you don't select any additional software it should only take a few minutes.
Finishing the install
At the end you'll see:
┌────────────┤ [!!] Finish the installation ├────────────────────┐ ┌│ Installation complete │ ││ Installation is complete, so it is time to boot into your new system. │ ││ Make sure to remove the installation media (CD-ROM, floppies), so │ ││ that you boot into the new system rather than restarting the │ ││ installation. │ ││ │ └│ <Go Back> <Continue> │ │ │ └───────────────────────────────────────────────────────────┘
Normally at this point you'd select <Continue> and your machine would reboot into your new install. Under Xen though, a reboot does not fully destroy the virtual machine. If the installer did do a reboot here, all that would happen is that Xen would restart the installer again. For that reason the installer has been set to halt here. You'll be dropped back to the Xen Shell prompt, and issuing a boot command will boot up your new VPS:
The system is going down NOW!ystem... │
Sending SIGTERM to all processes │
Sending SIGKILL to all processes─────────────────────────────────────┘
Requesting system halt
[ 4298.952440] md: stopping all md devices.
[ 4299.944797] xenbus_dev_shutdown: device/console/0: Initialising != Connected, skipping
[ 4300.295265] System halted.
xen-shell> boot
Booting instance: debtest1
pyGRUB version 0.6
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Debian GNU/Linux, kernel 2.6.26-2-xen-686 x
x Debian GNU/Linux, kernel 2.6.26-2-xen-686 (single-user mode) x
Started domain debtest1
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 2.6.26-2-xen-686 (Debian 2.6.26-26lenny1) (dannf@debian.org) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Thu Nov 25 02:32:31 UTC 2010
.
.
.Things you might like to change after install
By this point you've just completed a fresh install of Debian and it should be working fine, but you won't have some of the nice features of a typical BitFolk VPS image configured. Things you may wish to look into:
- Probably not all of your entries in /etc/apt/sources.lst are taking advantage of the apt-cacher.
- You either won't have an NTP server installed or else it won't be configured to talk to the NTP servers.
- /etc/resolv.conf will only have one of the two BitFolk DNS resolvers.
- Your /etc/fstab will be mounting things by device name, but it's recommended to change that to UUID or label. Future shanges to the Linux kernel are more likely to rename virtual block devices than devices for regular SATA disks, so it's wise to make sure that things mount properly even if this should happen.
- Your filesystems will be set to periodically fsck. Default BitFolk VPS installs have this disabled for performance reasons, and you might like to do that too.
Breaking out of the installer
If you do something wrong then you can generally fix it by going back to the installer's main menu. You get there by selecting Go back when given that option in a dialog. From the main menu of the installer you can retrace your steps. You can also start a shell if you need to poke around.
You can of course always create a new Xen Shell window, shutdown or destroy your running installer VPS and just start over again.