NEW_setup
creating an internal machine.
lvcreate 3 volumes:
dharra [~/alpineInternal]# lvdisplay -C
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
dharraSWAP dom0_swap -wi-ao---- 3.99g
internal_alp_A_VG1 nvmep3_lvm -wi-ao---- 2.00g
xen_VG1_P_alpineVirt_A nvmep3_lvm -wi-ao---- 5.00g
internal_alp_A_VG2 sataAB_data -wi-ao---- 40.00g
temp_storage_pool sataAB_data -wi-ao---- 500.00g
internal_alp_A_VG3 sataAB_swap -wi-ao---- 16.00g
--------------------------
make sure Shared LVM temp_storage_pool is mounted /media/floppy ... for the image
make sure the image (ISO) is mounted in /media/usb
---------------
dharra [~/alpineInternal]# cat xen_config_alpineServer_4setup.xl
name = "alpineInternal_A"
# Kernel paths for install
kernel = "/media/usb/boot/vmlinuz-virthardened"
ramdisk = "/media/usb/boot/initramfs-virthardened"
extra="modules=loop,squashfs console=hvc0"
disk = [
'/dev/mapper/nvmep3_lvm-internal_alp_A_VG1,raw,xvda,rw',
'/dev/mapper/sataAB_data-internal_alp_A_VG2,raw,xvdb,rw',
'/dev/mapper/sataAB_swap-internal_alp_A_VG3,raw,xvdc,rw',
'/media/floppy/images/alpine-virt-3.7.0-x86_64.iso,raw,xvdd,devtype=cdrom,ro' ###hide this to boot in HVM w/o the cdrom
]
boot = 'dc'
##domU settings
vcpus = 2
maxvcpus = 3
memory = 8192
vif = [ 'mac=xx:xx:xx:xx:xx:42, bridge=xenbr0' ]
on_reboot = 'restart'
on_crash = 'restart'
## scary name but it means domain is shut down.
on_poweroff = 'destroy'
### remote GUI
stdvga = 1
videoram = 128
vnc = 1
vnclisten= '0.0.0.0'
vncunused=1
vncconsole = 1
vncdisplay = 23
vncpasswd = "some_secure_shit"
------------------------------
boot.
eth0 will get IP from 10.xx.x.X range from the xenbr0 of the dom0
the default gw is 10.x.x.y1 ...the chottu machine running w/ one leg in xenbr0 (as eth1)
IP FORWARDING HAS been setup on chottu between xenbr0 (eth1) and br0 (eth2) interfaces - also IP_FORWARD is allowed. THUS, CHOTTU IS HOP + ROUTER
setup-alpine...take it till the end (i.e. choose xvda for install).
then fdisk /dev/xvda
delete the swap and root partitions.
create a new partition w/ ext4 for root (xvda2).
xvda1 should be boot (of circa 100 MB).
mount /dev/xvda2 /mnt
cd /mnt
mkdir boot
mkdir root
mount /dev/xvda1 ./boot
mount /dev/xvdb1 ./root
setup-disk -v -m sys /mnt
cd /mnt/boot/
mkdir grub
cd grub
vi menu.lst:
internal1:/boot/grub# cat menu.lst
#/boot/grub/menu.lst
default 0
timeout 5
title alpine-xen-pv
root (hd0,0)
kernel /vmlinuz-virthardened modules=sd-mod,ext4,squashfs console=hvc0 root=/dev/xvda2
initrd /initramfs-virthardened
cd /mnt/etc/
mkswap /dev/xvdc
.... NOTE THE UUID
vi fstab (like so..)
internal1:/etc# cat fstab
UUID=4432fe81-6363-4ae9-b1ac-e75b7f5091a1 / ext4 rw,relatime,data=ordered 0 1
UUID=a4f8a756-6003-4850-95c1-4fa8a732c931 /boot ext4 rw,relatime,data=ordered 0 2
UUID=c036514f-c749-4ef4-b903-bc3df010dca4 /root ext4 rw,relatime,data=ordered 0 2
UUID=c5f13c17-e5e0-4e36-81f7-c6812583edbb swap swap defaults 0 0
/dev/cdrom /media/cdrom iso9660 noauto,ro 0 0
/dev/usbdisk /media/usb vfat noauto 0 0
poweroff.
------------------------------------------
change the XL CONFIG:
dharra [~/alpineInternal]# cat xen_config_alpineServer_RUNNING.xl
name = "alpineInternal_A"
# Kernel paths for install
kernel = "/usr/lib/xen/boot/pv-grub-x86_64.gz"
disk = [
'/dev/mapper/nvmep3_lvm-internal_alp_A_VG1,raw,xvda,rw',
'/dev/mapper/sataAB_data-internal_alp_A_VG2,raw,xvdb,rw',
'/dev/mapper/sataAB_swap-internal_alp_A_VG3,raw,xvdc,rw',
###'/media/floppy/images/alpine-virt-3.7.0-x86_64.iso,raw,xvdd,devtype=cdrom,ro' ###hide this to boot in HVM w/o the cdrom
]
##domU settings
vcpus = 2
maxvcpus = 3
memory = 8192
vif = [ 'mac=xx:xx:xx:xx:xx:42, bridge=xenbr0' ]
on_reboot = 'restart'
on_crash = 'restart'
## scary name but it means domain is shut down.
on_poweroff = 'destroy'
### remote GUI
stdvga = 1
videoram = 128
vnc = 1
vnclisten= '0.0.0.0'
vncunused=1
vncconsole = 1
vncdisplay = 23
vncpasswd = "some_secure_shit"
======================
boot w/ the new XL config... VIOLA ... gets 10.20.1..IP adress and can reach internet.
dharra [~/alpineInternal]# xl list
Name ID Mem VCPUs State Time(s)
Domain-0 0 512 8 r----- 171.6
alpineJUMP 7 3968 1 -b---- 31.3
alpineInternal_A 19 8064 2 -b---- 7.1
dharra [~/alpineInternal]# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.408d5c4d660c no eth0
vif7.2
xenbr0 8000.feffffffffff no vif19.0
vif7.0
vif7.1
======================================
cloning VM
lvcreate -L 40G -n sataAB_data-xen_VG2_P_Internal_A sataAB_data
....similarly for the other 2 volumes.
cp /etc/xen/alpine_Internal1_RUNNING.xl /etc/xen/alpine_Internal2_RUNNING.xl
edit Internal2 - mac/name/vnc address and CHANGE to NEW DISK
boot the new VM. Change /etc/hostname & /etc/network/interfaces (hostname here).