Saturday, September 30, 2017

Debian Stretch: XEN configure & create DomU PV Debian part 3

We will use xen-tools to make it easier to create guest.

Configure /etc/xen-tools/xen-tools.conf
# vi /etc/xen-tools/xen-tools.conf
...
# lvm = vg0
lvm = volGroup1
...
install-method = debootstrap
...
debootstrap-cmd = /usr/sbin/debootstrap
...
size   = 80G       # Root disk, suffix (G, M, k) required
memory = 2G # Suffix (G, M, k) required
#maxmem = 2G      # Suffix (G, M, k) optional
swap   = 3G # Suffix (G, M, k) required
# noswap = 1      # Don't use swap at all for new systems.
fs     = ext4     # Default file system for any disk
dist   = `xt-guess-suite-and-mirror --suite`
                  # Default distribution is determined by Dom0's distribution
...
gateway = [your_ip_gateway]
netmask = [your_ip_netmask]
broadcast = [your_ip_broadcast]
...
nameserver = 8.8.8.8
...
bridge = br0
...
passwd = 1
...
pygrub = 1
...
mirror = `xt-guess-suite-and-mirror --mirror`
...

You can create your guest by command
# xen-create-image --hostname xdebian801 --ip=[your_ip]
...
Setting up root password
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
All done
Logfile produced at:
         /var/log/xen-tools/xdebian801.log

Installation Summary
---------------------
Hostname        :  xdebian801
Distribution    :  stretch
MAC Address     :  00:16:3E:61:28:46
IP Address(es)  :  [your_ip]
SSH Fingerprint :  SHA256:GVI1ri+NA82lDeVEf+pPgSHYFHzLe+SYkCxuTgBfEZw (DSA)
SSH Fingerprint :  SHA256:s5z6k6ek+V43NDG1CX77E81WWCVXZEOYNTEaQTXAaGM (ECDSA)
SSH Fingerprint :  SHA256:FUmWelgtmKtB/sCqrS3P5ZlttVRD/M0IVrArPnUs/8Y (ED25519)
SSH Fingerprint :  SHA256:LvrUnZE3ktnahsWFi+hXZ78+V87YZfmDKi9E01Rn+Zs (RSA)
Root Password   :  N/A

Start your guest
# xl create /etc/xen/xdebian801.cfg
# xl list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0 11815    24     r-----     653.2
xdebian801                                   5  2048     1     -b----       3.5

State:
  • r - running
  • b - blocked
  • p - paused
  • s - shutdown
  • c - crashed
  • d - dying

Connect to your guest
# xl connect xdebian801

To make your guest start after boot/restart
# mkdir /etc/xen/auto
# ln -s /etc/xen/xdebian801.cfg /etc/xen/auto/xdebian801.cfg

Example command to override default configuration during image creation:
# xen-create-image --hostname myexample --ip=192.168.1.1  --size=40G  --swap=2G --memory=1G --vcpus=2

References:

  1. http://blog.noviantech.com/2010/06/23/debian-kernels-and-tigon-tg3-firmware/
  2. https://wiki.debian.org/Firmware
  3. https://wiki.debian.org/LVM
  4. https://wiki.debian.org/LinuxRaidForAdmins
  5. https://ycnrg.org/xen-install-os-from-iso-pv/
  6. http://hwraid.le-vert.net/

No comments:

Post a Comment