Difference between revisions of "XenServer"
(→ethtool network stuff) |
(→SATA Direct Local Disk Access) |
||
Line 1: | Line 1: | ||
=SATA Direct Local Disk Access= | =SATA Direct Local Disk Access= | ||
− | http://techblog.conglomer.net/sata-direct-local-disk-access-on-xenserver/ | + | *http://techblog.conglomer.net/sata-direct-local-disk-access-on-xenserver/ |
+ | If/when Xen updates it will overwrite this file, you will have to add the lines again. | ||
nano -w /etc/udev/rules.d/50-udev.rules | nano -w /etc/udev/rules.d/50-udev.rules | ||
Add to the end | Add to the end | ||
ACTION=="add", KERNEL=="sdb", SYMLINK+="xapi/block/%k", RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'" | ACTION=="add", KERNEL=="sdb", SYMLINK+="xapi/block/%k", RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'" | ||
ACTION=="remove", KERNEL=="sdb", RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'" | ACTION=="remove", KERNEL=="sdb", RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'" | ||
− | Reboot Xen Server | + | Reboot Xen Server... |
=ethtool network stuff= | =ethtool network stuff= |
Revision as of 09:16, 13 October 2015
Contents
- 1 SATA Direct Local Disk Access
- 2 ethtool network stuff
- 3 Snapshots and Cloaning
- 4 Commands
- 5 Creating Local ISO Repo - LVM
- 6 Applying Official Patches
- 7 List Patches
- 8 What?
- 9 PCI Passthrough
- 10 Changing domU Memory
- 11 Network
- 12 ToDo
- 13 Adding an additional hard drive to XenServer
- 14 Adding a existing network to a VM
SATA Direct Local Disk Access
If/when Xen updates it will overwrite this file, you will have to add the lines again.
nano -w /etc/udev/rules.d/50-udev.rules
Add to the end
ACTION=="add", KERNEL=="sdb", SYMLINK+="xapi/block/%k", RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'" ACTION=="remove", KERNEL=="sdb", RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'"
Reboot Xen Server...
ethtool network stuff
- http://old-list-archives.xenproject.org/xen-users/2007-01/msg00460.html
- https://lists.debian.org/debian-user/2009/09/msg00806.html
- https://blogs.citrix.com/2011/04/14/using-ethtool-settings-to-address-network-performance-issues/
- http://wiki.xen.org/wiki/Network_Throughput_and_Performance_Guide
Snapshots and Cloaning
https://www.youtube.com/watch?v=Do68cDMVFiw
xe vm-snapshot vm=name new-name=label=name2 new-name-description=Testing
xe vm-list
xe snapshot-list snapshot-of=
Can only copy when VM is shutdown. Other solution, if I remember is to snapshot, and then copy or something.
xe vm-copy vm="ABCServer" sr-uuid=24565487-accf-55ed-54da54993ade784a new-name-label="Copy of ABCServer" new-name-description="New Description"
Export live running VM: http://www.xenlens.com/export-a-live-running-vm-guest-from-xenserver-host/
Commands
- http://docs.vmd.citrix.com/XenServer/6.2.0/1.0/en_gb/reference.html
- https://xapi-project.github.io/xen-api/classes/sr.html
xe sr-create
type=
- type - type of the SR, used to specify the SR backend driver to use
- SR - storage repository
xe sr-probe
device-config:
Creating Local ISO Repo - LVM
pvscan lvcreate -L 50G -n ISORepo VG_XenStorage-d2e116af-c45b-e6ba-5965-abc7e85c88c7 lvscan mkfs.ext3 /dev/VG_XenStorage-d2e116af-c45b-e6ba-5965-abc7e85c88c7/ISORepo mkdir /mnt/ISORepo
fstab
/dev/VG_XenStorage-d2e116af-c45b-e6ba-5965-abc7e85c88c7/ISORepo /mnt/ISORepo ext3 defaults 0 1
Mount it then:
xe sr-create name-label=ISORepo type=iso device-config:legacy_mode=true device-config:location=/mnt/ISORepo content-type=iso uuidoutput: 93a71420-d899-58e7-bce4-26d9cd4f6e46
This is supposed to refresh the repo, but with legacy mode it is supposed to do that itself:
xe sr-scan uuid=93a71420-d899-58e7-bce4-26d9cd4f6e46
Additional LVMs do not activate on boot!!! Do this:
nano /etc/rc.sysinit
Uncomment:
#if [ -x /sbin/lvm.static ]; then # action $"Setting up Logical Volume Management:" /sbin/lvm.static vgchange -a y --ignorelockingfailure #fi
Source
- Activate LVM On Boot: http://notes.rioastamal.net/2014/05/xenserver-62-fix-unrecognized-lvm-on-boot.html
- http://discussions.citrix.com/topic/257054-local-iso-repository/
Activate LVM on Boot on XenServer
To activate on boot we need to make small modification to file /etc/rc.sysinit around line 487 to 489. Take a look into these lines:
#if [ -x /sbin/lvm.static ]; then # action $"Setting up Logical Volume Management:" /sbin/lvm.static vgchange -a y --ignorelockingfailure #fi
That's the problem, the lines which activate the LVM volume is commented. That's why we ended up with the problem. Now just uncomment those lines and save the file. But make sure you made a copy of it. Reboot the server and all LVM volumes should be detected on boot. Here's an example of my XenServer custom partition scheme:
LABEL=root-mterkkri / ext3 defaults 1 1 #/var/swap/swap.001 swap swap defaults 0 0 none /dev/pts devpts defaults 0 0 none /dev/shm tmpfs defaults 0 0 none /proc proc defaults 0 0 none /sys sysfs defaults 0 0 /opt/xensource/packages/iso/XenCenter.iso /var/xen/xc-install iso9660 loop,ro 0 0
/dev/mapper/VG--XEN01-Dom0--TMP /tmp ext2 defaults,noexec,nosuid,nodev 1 2 /dev/mapper/VG--XEN01-Dom0--SWAP swap swap defaults 0 0
/tmp /var/tmp none rw,noexec,nosuid,nodev,bind 1 2
Applying Official Patches
wget http://downloadns.citrix.com.edgesuite.net/10340/XS65ESP1.zip unzip XS65ESP1.zip xe patch-upload -s 127.0.0.1 -u root -pw eliteelite file-name=XS65ESP1.xsupdate
Or
xe patch-upload file-name=XS65ESP1.xsupdate
Outputs UUID
7f2e4a3a-4098-4a71-84ff-b0ba919723c7 xe -s 127.0.0.1 -u root -pw eliteelite patch-pool-apply uuid=7f2e4a3a-4098-4a71-84ff-b0ba919723c7
Or
xe host-list xe patch-apply uuid=7f2e4a3a-4098-4a71-84ff-b0ba919723c7 host-uuid=94a5ec24-cfa9-4592-bf73-7ed04a215bc6
List Patches
xe patch-list [1]
What?
xe-toolstack-restart
PCI Passthrough
Knowing if pciback support is active: http://wiki.xenproject.org/wiki/Xen_Kernel_Feature_Matrix#pvops
Only Temp?
lspci
03:00.0 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06) 03:00.1 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06) 04:00.0 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06) 04:00.1 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06) xl pci-assignable-add 03:00.0 xl pci-assignable-add 03:00.1 xl pci-assignable-add 04:00.0 xl pci-assignable-add 04:00.1 xl pci-assignable-list
Kernel Line
nano -w /boot/extlinux.conf
Add (Old Way):
pciback.hide=(01:00.0)(00:02.0)
Add (New Way):
xen-pciback.hide=(01:00.0)(00:02.0)
- I just tried the old way on 6.5SP1 xenserver and it is working
Add it to a domU:
- For more then one:
xe vm-param-set other-config:pci=0/0000:03:00.0,0/0000:03:00.1,0/0000:04:00.0,0/0000:04:00.1 uuid=46bca2ec-2756-73cd-de4c-e60068a95a84
- For one:
xe vm-param-set other-config:pci=0/0000:03:00.1 uuid=46bca2ec-2756-73cd-de4c-e60068a95a84
xe vm-param-list uuid=46bca2ec-2756-73cd-de4c-e60068a95a84
Error("38: Function not implemented")
You most likley do not IOMMU or have it disabled in the BIOS.
Changing domU Memory
xl mem-set #Not going to use xe vm-list xe vm-list params=all uuid=46bca2ec-2756-73cd-de4c-e60068a95a84
Output:
memory-static-max ( RW): 268435456 memory-dynamic-max ( RW): 268435456 memory-dynamic-min ( RW): 268435456 memory-static-min ( RW): 134217728
Set it: (try KiB, MiB, GiB or TiB)
xe vm-param-set memory-static-max=4GiB uuid=46bca2ec-2756-73cd-de4c-e60068a95a84 xe vm-param-set memory-dynamic-max=4GiB uuid=46bca2ec-2756-73cd-de4c-e60068a95a84 xe vm-param-set memory-dynamic-min=4GiB uuid=46bca2ec-2756-73cd-de4c-e60068a95a84 xe vm-param-set memory-static-min=4GiB uuid=46bca2ec-2756-73cd-de4c-e60068a95a84
What does vm-memory-limits-set do?
Network
xe network-list xe network-destroy xe pif-list xe pif-forget
ToDo
- Get notifications about new updates
Adding an additional hard drive to XenServer
fdisk -l xe sr-create name-label=2TBNoRaid shared=false device-config:device=/dev/sdb type=lvm
Adding a existing network to a VM
xe vm-list xe network-listxe vif-create network-uuid=<networkuuid> vm-uuid=<vmuuid> device=2