I want to save this little trick for later. To get vi(m) to show line numbers, use the following command:
:set nu
Hit escape first in case you’re in input mode. Then simply type the colon set nu and hit enter.
I want to save this little trick for later. To get vi(m) to show line numbers, use the following command:
:set nu
Hit escape first in case you’re in input mode. Then simply type the colon set nu and hit enter.
When Xenserver 7 came out I found myself unable to easily upgrade to it thanks to my custom RAID 1 build. If I wanted Xenserver 7 I would have to blow the whole instance away and start from scratch. This posed a problem because I have a pool of 2 xenserver hosts. You cannot add a server with a higher xenserver version to a lower versioned pool; the pool master must always have the highest version of Xenserver installed. My decision to have an mdadm RAID 1 setup on my pool master ultimately turned into forced VM downtime for an upgrade despite having a pool of other xenserver hosts.
After transferring VMs to my secondary host and promoting it to pool master, I wiped my primary xenserver and installed 7. When it was up and running I essentially had two separate pools running. To transfer my VMs back to my primary server I had to resort to the command line.
The xe vm-export and vm-import commands work with stdin/out and piping. This is how I accomplished transferring my VMs directly between two pools. Simply pipe xe vm-export commands with an ssh xe vm-import command like so:
xe vm-export uuid=<VM_UUID> filename= | ssh <other_server> xe vm-import filename=/dev/stdin
Note the lack of a filename – this instructs xenserver to pipe to standard output instead. Also note that transferring the VM scrambles the MAC addresses of its interfaces. If you want to keep the MAC address you’ll have to manually re-assign it after the copy is complete.
For the method above you will have to turn the VM off in order to transfer it. I had some VMs that I didn’t want to stay down for the entire transfer. A way around this is to take a snapshot of the VM and then copy the snapshot to the other pool. Note that this method does not retain any changes made inside the VM that occurred after you took the snapshot. You will have to manually transfer any file changes that took place during the VM transfer (or be fine with losing them.)
In order to export a snapshot you must first convert it to a VM from a template (thanks to this site for outlining how.) The full procedure is as follows:
xe vm-snapshot uuid=<VM_UUID> new-name-label=<snapshotname>
xe template-param-set is-a-template=false ha-always-run=false uuid=<UUID of snapshot>
xe vm-export uuid=<UUID of snapshot> filename= | ssh <other_server> xe vm-import filename=/dev/stdin
I used both methods above to successfully move my VMs from my older 6.5 pool to the newer 7 pool. Success.
I’ve recently upgraded to the latest version of Citrix Xenserver 7 (codenamed “Dundee”.) 7 is based on CentOS 7 and has a massive amount of changes under the hood. One such change was how they handle PCI Passthrough.
It took some time to figure PCI Passthrough out. 7 uses grub instead of extlinux for the bootloader. It appears to be grub2 but they don’t use the standard update-grub tool, rather you simply edit the config file and do nothing else.
After much searching I found this post which led me in the right direction. In Xenserver 7, for pci passthrough support you must do the following:
xe vm-param-set other-config:pci=0/0000:B:D.f uuid=<vm uuid>
xen-pciback.hide=(B:D.f)
You will now be able to pass through hardware to your virtual machines in Xenserver 7. Hooray.
When trying to update crouton I kept getting the following error message:
Preparing to unpack .../linux-image-3.8.11_20150314_amd64.deb ... Ok, aborting, since modules for this image already exist. dpkg: error processing archive /var/cache/apt/archives/linux-image-3.8.11_20150314_amd64.deb (--unpack):
After some digging I found this thread which explains how to fix it. The source of the problem was the fact that I had installed a modified kernel to allow VirtualBox to work properly. The way to update crouton is to remove the repository for that kernel
rm /etc/apt/sources.list.d/crouton-packages.list
After removing that repository the update completed successfully.