Citrix XenServer – How to Convert HVM to PV

In order to take advantage of some XenServer features, you need to have a paravirtualization (PV) turned on for your guest host.  You maybe running in HVM because you installed your operating system from a disk and not a XenServer created template.  Now days xen is built into the linux kernel and we don’t need a special kernel installed.  We just need to change the settings in XenServer to boot the system.

Note: I tested this on Ubuntu 14.04 and 16.04 with systems that already had XenTools installed.  I’m assuming the procedure doesn’t change much to other distros.

  1. Find the UUID of the guest host you want to convert from HVM to PV
    xe vm-list name-label=<name of guest host>
  2. Print out the current parameters for the guest host and save them as a backup.
    xe vm-param-list uuid=<uuid from step 1>
  3. Update parameters to boot your system as paravirtualization
    xe vm-param-set uuid=<uuid from step 1> HVM-boot-policy=""
    xe vm-param-set uuid=<uuid from step 1> PV-bootloader=pygrub
    xe vm-param-set uuid=<uuid from step 1> PV-args="-- quiet console=hvc0"
  4. Find the UUID for your VDB boot disk
    xe vm-disk-list uuid=<uuid from step 1>
  5. Set the drive as bootable
    xe vbd-param-set uuid=<uuid from step 4> bootable=true
  6. Boot the system and review the console in XenCenter.  If the system boots, BUT you don't get the login window, you may need to complete create this config file.
    1. Create this file if it doesn't exist on your guest host: /etc/init/hvc0.conf
    2. # hvc0 - getty
      #
      # This service maintains a getty on hvc0 from the point the system is
      # started until it is shut down again.

      start on stopped rc RUNLEVEL=[2345]
      stop on runlevel [!2345]

      respawn
      exec /sbin/getty -L hvc0 9600 linux

    3. Reboot

Will The Future Honor The Past

In May of 2011, Barack Obama signed this Cyberspace policy. Will we follow this policy going forward, post Obama? Or will we shoot from the hip?

When warranted, the United States will respond to hostile acts in cyberspace as we would to any other threat to our country. All states possess an inherent right to self-defense, and we recognize that certain hostile acts conducted through cyberspace could compel actions under the commitments we have with our military treaty partners.We reserve the right to use all necessary means—diplomatic, informational, military, and economic—as appropriate and consistent with applicable international law, in order to defend our Nation, our allies, our partners, and our interests. In so doing, we will exhaust all options before military force whenever we can; will carefully weigh the costs and risks of action against the costs of inaction; and will act in a way that reflects our values and strengthens our legitimacy, seeking broad international support whenever possible.

Source: https://www.whitehouse.gov/sites/default/files/rss_viewer/international_strategy_for_cyberspace.pdf

Back up source: international strategy for cyberspace

I fear for a time when a physical attack is the answer to a cyber attack, as knowing the true source of the attack can be tricky in any circumstance.  May I never need to reference this post in the future.

How To Add A Static Route To NetApp Data OnTap

Use this command to add a static route for this network 10.3.50.0/24 to use the gateway 10.3.0.1

route add net 10.3.50.0/24 10.3.0.1 1

You must also update /etc/rc because you will lose this route on a reboot.  /etc/rc gets read at boot and sets up your network settings.

Use this command to read the file

rdfile /etc/rc

Copy all the text that it outputs.  Add your route command under your default gateway.  It should look something like this:

hostname netapp01
ifgrp create lacp ifgrp1 -b ip e0a e0b e0c e0d 
vlan create ifgrp1 3001 3002 3000
ifconfig ifgrp1-3001 `hostname`-ifgrp1-3001 netmask 255.255.255.0 partner ifgrp1-3001 mtusize 1500 -wins
ifconfig ifgrp1-3002 `hostname`-ifgrp1-3002 netmask 255.255.255.0 partner ifgrp1-3002 mtusize 1500 -wins
ifconfig ifgrp1-3000 `hostname`-ifgrp1-3000 netmask 255.255.255.0 partner ifgrp1-3000 mtusize 1500 -wins
route add default 10.3.2.254 1
route add net 10.3.50.0/24 10.3.0.1 1
routed on
options dns.domainname domain.someplace.com
options dns.enable on
options nis.enable off

In order to write your changes to the /etc/rc file, you need to use this command.  This command overwrites the file with everything you enter at this point.

wrfile /etc/rc

As a side note, the IPs for your interfaces are stored in the /etc/hosts file.

Citrix XenServer – Ubuntu 14.04 Install/Upgrade Bootloader Error

After upgrading from ubuntu 12.04 to 14.04 I get an error message in XenCenter when booting for the first time into 14.04.

The bootloader for this VM returned an error -- did the VM installation succeed? Unable to find partition containing kernel

Fixed this error by editing this file on my XenServer Hosts.
* Edit: /usr/lib/python2.4/site-packages/grub/GrubConf.py
** Replace if arg.strip() == "${saved_entry}":
** With if arg.strip() == "${saved_entry}" or arg.strip() == "${next_entry}":

Citrix XenServer Error: SR_BACKEND_FAILURE_65

I’ve been having issues attaching a VDI to a VM from a NetApp snapshot.  Basically a storage level snapshot that happen while the server was live.  I keep getting the error “The attempt to load the VDI failed” via XenCenter when I try and boot the VM.  I would then look at the log file: /var/log/xensource.log.  I would see that the VM was tossing out the error “SR_BACKEND_FAILURE_65” when it tried to boot.

I have been unable to get the VDI to load on any server.  I even contacted Citrix looking for help and they were unable to get the VDI to load as well.  I’ve seen several others on the internet run into this issue without a resolution.   If someone knows of a trick to get these VDIs to load, please leave a comment!

Hope this helps!

Citrix XenServer Error: The SR failed to complete the operation

Yesterday we started to run out of space on one of our storage repositories.  When we tried to move any VDI on that SR via XenCenter, we got the error “The SR failed to complete the operation”.  Which is a pretty generic error, par for xenserver errors.  I even got the same error when trying to do a ‘Rescan’.

I continued to troubleshoot, looking through logs and command outputs.  I finally found something to look into.

Ran the command:
xe sr-param-list uuid=eb943814-a329-5f84-bd42-af1858d56632

Noticed this parameter:
other-config (MRW): dirty: ; auto-scan: false

I looked into this “dirty” param…  It means xenserver isn’t happen with the file names on the SR.   I listed the files on my SR and saw that someone created a manual copy of a VDI called: Copy of f897ebcf-9365-471b-8a30-e81f564c2536.vhd.

I fixed it by:

* Removing file: Copy of f897ebcf-9365-471b-8a30-e81f564c2536.vhd
* Rescanning the SR
* I was then able to move the VDI from one SR to another with out error.

 

Hope this helps with your day:

Citrix XenServer 6.5 Performance Comparison

Noticed this on the Citrix blog today. A nice little performance comparison between ESXi 5.5 and XenServer 6.5. Citrix claims to show a 11-16% performance advantage over VMware.  I’m holding off on upgrading to 6.5 till summer, but can’t wait to run some of my own benchmarks against XenServer 6.2.

Citrix XenServer 6.5 Is Here!

Xenserver 6.5 promises to provide more performance, more GPU access, and bring back Workload Balancing (WLB).  I won’t be applying 6.5 for a few months, so please let me know of any experiences you have in the comments.

Juicy details here!

http://support.citrix.com/servlet/KbServlet/download/38334-102-714582/XenServer-6.5.0-releasenotes.pdf

Changes Coming In Citrix XenServer

I was just getting caught up on some Citrix information and ran across this blog post.  I’m happy to see they are addressing the concern of XenServer being dropped as a product once it was open sourced.  And I’m glad to hear they will be moving it forward with some big changes I didn’t even know needed to happen.  Like moving dom0 to 64-bit.  When I read that, I had to jump on one of my 6.2 servers and do a quick `uname -a` to see if it was true!   And sure enough, it’s kernel is compiled for i686.

Here are the official the preview release notes Citrix gave out:
http://www.citrix.com/content/dam/citrix/en_us/documents/downloads/xenserver/xs-tech-preview-release-notes.pdf