Upgrading Xen Tools on Rackspace NextGen Windows 2008 Servers

The following steps are for Rackspace Windows Next Generation servers ONLY that have been recently upgraded from First Generation Platform
DO NOT try to run on first generation servers
IF IN DOUBT ASK

WARNING THIS ARTICLE IS OUTDATED

Please use the following link for more information on upgrading Windows 2008 Xen Tools.

https://support.rackspace.com/how-to/upgrade-citrix-xen-server-tools-for-windows-cloud-servers/

Please only perform these steps if you know exactly what you are doing.

1. Stop and remove the Openstack guest agent service
1.1 Open a command prompt by clicking the Start menu, selecting Run… and typing the following command followed by an enter:
cmd
1.2 Once the command prompt is open, type the following commands to stop and then remove the Openstack guest agent service named “Rackspace Cloud Servers Agent” here
sc stop RackspaceCloudServersAgent
sc delete RackspaceCloudServersAgent
1.3 Ensure that the Rackspace Cloud Servers Agent is no longer listed in your list of services (you can check this via the Services panel in Control Panel > Administrative Tools)
2. Download the updated Openstack guest agent service (if you have not already) from https://github.com/rackerlabs/openstack-guest-agents-windows-xenserver/releases/download/1.3.0.3/AgentService.zip
3. Once downloaded, extract the .zip file to the following directory:
C:\Program Files\Rackspace\Cloud Servers\Agent
3.1 If you had the agent installed there already, the file manager is going to ask you whether to overwrite the files found there with the ones being extracted, answer by saying to replace everything
4. Navigate to the folder where you extracted this archive and launch the installagentservice.bat batch file (depending on the file manager you may not see the .bat file extension)
5. Ensure that you have Rackspace Cloud Servers Agent listed in your Services panel (you may need to click the refresh button to see it)

At this point, you should have the Openstack guest agent service version 1.3.0.3 installed and running.

To install the Citrix Xentools driver package
1. (if you have not already) download it from http://b2566e7bb4c60838ad8e-2feac036ecfab0eba46621f3ae4943bc.r28.cf1.rackcdn.com/xen_tools_65_20200_Server_2008_and_R2.zip
2. Extract the archive to a temporary folder
3. Run the install.bat file and wait for the installation to finish completely (it will disconnect the RDP session and reboot your server multiple times)
4. Once your server is up, you can check the installed Citrix branded entries in your Programs and Features control panel page
4.1 If you don’t see version numbers there, you can either just select the entires to view their version in the detail section on the bottom of that window, or you may want to enable the version column by pressing the ‘alt’ button once, in the resulting menu selecting ‘View > Choose Details…’ and ticking the box next to ‘Version’ in the list.

Updating Xen Server PV Drivers

So you want to update your PV Drivers for your machine. You might want to do this if you are for instance migrating a VM with older PV tools, and you want to use on a newer Hypervisor. Some windows machines are particularly sensitive and can sometimes crash if the latest tools are not installed. In this case no tools are intalled at all on a 5.6 host. So we are going to install the PV 5.6 drivers.

This may be of use to Rackspace customers of the first generation platform.

Install/Upgrade PV Drivers Linux

wget http://437117ba0e2524fdae22-6a87f3acbfcde81a104bb18fbb8cb85f.r47.cf2.rackcdn.com/xen_tools_installer.sh; 
chmod u+x xen_tools_installer.sh; bash xen_tools_installer.sh; rm -rf xen_tools_installer.sh

Install/Upgrade PV Drivers Windows

# Xenserver 5.6 PV Drivers
http://8d268c176171c62fbd4b-7084e0c7b53cce27e6cc2142114e456e.r30.cf1.rackcdn.com/xstools-5.6.zip
# Xenserver 6.0 PV Drivers
http://8d268c176171c62fbd4b-7084e0c7b53cce27e6cc2142114e456e.r30.cf1.rackcdn.com/xstools-6.0.zip
# Xenserver 6.1 PV Drivers
http://8d268c176171c62fbd4b-7084e0c7b53cce27e6cc2142114e456e.r30.cf1.rackcdn.com/xstools-6.1.zip
# Xenserver 6.2 PV Drivers
http://8d268c176171c62fbd4b-7084e0c7b53cce27e6cc2142114e456e.r30.cf1.rackcdn.com/xstools-6.2.zip

The windows setup is a lot simpler. Just download a zip for your version of Xen Server (MAKE SURE YOU KNOW WHICH ONE! IMPORTANT), and then run the xensetup.exe. Simples!

From the Hypervisor side

It’s possible to use xenstore-ls and check against the domain for the PV drivers in the attr attribute;

Tools not installed example, empty attr

# xenstore-ls /local/domain/218 | grep attr
attr = ""

Upgrading Xen Tools to 6.0 and/or 6.2

# Upgrade to 6.0 , then upgrade to 6.2.0

Xen Tools 6.0.2 Download

http://63773473543190a035ec-a897bd33ba42b6c03ac54566871e97ca.r54.cf2.rackcdn.com/xs-tools-6.0.2-58937.zip

Xen Tools 6.2.0 Download

 
http://8d268c176171c62fbd4b-7084e0c7b53cce27e6cc2142114e456e.r30.cf1.rackcdn.com/xstools-6.2.zip

# Upgrade to 6.2 Use the above guide but replace the download link with this one.

http://8d268c176171c62fbd4b-7084e0c7b53cce27e6cc2142114e456e.r30.cf1.rackcdn.com/xstools-6.2.zip

Thanks to my colleague Aaron for finding these links

General Instructions:
https://support.rackspace.com/how-to/installing-xenserver-tools-on-next-generation-windows-cloud-servers/

Updating Metadata and inside view on Cloud Servers and thru Nova API

So, a customer today was playing around with some metadata i.e.

“meta”: {
“rax-heat”: “dfdjh32j21-121c-411d-912c-77209ffc6642”
},

He understood setting the meta data key value pairs like;

nova meta platform-minion0-pp.gb-lon1.kubernetes.metroscales.io set foo=bar

and wanted to retrieve inside and outside of the VM. This is easy to do and can be done like

supernova lon show 812c7fed-ae3b-43ff-a0a1-0f07d52b795a | grep metadata
| metadata                            | {"rax-heat": "dfdjh32j21-121c-411d-912c-77209ffc6642", "foo": "bar", "rax_service_level_automation": "Complete"} |

or with nova

nova show 812c7fed-ae3b-43ff-a0a1-0f07d52b795a | grep metadata

Also it can be done inside the VM directly with xenstore-read

xenstore-read vm-data/user-metadata/build_config

Upgrading Xen Tools on Rackspace Cloud instance Virtual Machine

So, what with the first gen to next gen migrations ongoing, a lot of people may need to upgrade their xen server tools to the most recent version. Anyone who is running 5.5 or lower should upgrade to xs tools 6.2.0 pronto, it’s much more stable and fixes a lot of bugs that might exist in the earlier tool verisons. Here is how to do it.

But first ALWAYS TAKE A BACKUP IMAGE

Just in case. Remember installing XEN TOOLS can break your container if done incorrectly or if god hates you .

wget http://boot.rackspace.com/files/xentools/xs-tools-6.2.0.iso

mkdir -p tmp; mount -o loop xs-tools-6.2.0.iso tmp; cd tmp/Linux; ./install.sh; cd ../..; umount tmp

An excellent guide

https://support.rackspace.com/how-to/installing-xenserver-tools-on-next-generation-windows-cloud-servers/

Deploying Devstack successfully in CentOS 7

So, do you want to setup your own openstack infrastructure? With Cinder, Nova, nova API, keystone and the such? That’s easy enough. Here is how to do it.

Step 1. Deploy CentOS7, any basic install should be fine. I deployed using the Rackspace cloud server 8Gigs standard instance type. (standard install should be fine!)

Step 2. Add stack user

adduser stack

Step 3. Add stack to sudoers wheel group, ensuring sudo is there

yum install -y sudo
echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

Step 4. Modify /etc/passwd so that the home directory for stack is /opt/stack . It needs this. And chown

vi /etc/passwd
# make sure home directory for stack is /opt/stack (thats all!)
mkdir /opt/stack
chown -R stack:stack /opt/stack

Step 5. Clone Devstack from git

sudo yum install -y git
su stack
git clone https://git.openstack.org/openstack-dev/devstack
cd devstack

Step 6. Cp base config sample file

cp samples/local.conf .

Step 7. Deploy stack

./stack.sh

Retrieving Xenstore Networking settings from within a Rackspace Server

When a customer of ours is having issues with their networking, such as the configured gateway or netmask, we are able to provide a oneliner that allows them to run on the VM guest a command which takes the information directly from xenstore, (xe-linux-distribution). Find the command below.

xenstore-read vm-data/networking/$(xenstore-ls vm-data/networking | awk '/private/{print$1}')
{"label": "private", "broadcast": "10.255.255.255", "ips": [{"ip": "10.177.194.237", "netmask": "255.255.255.0", "enabled": "1", "gateway": null}], "mac": "BC:76:4E:11:11:11", "dns": ["83.138.151.81", "83.138.151.80"], "routes": [{"route": "10.208.0.0", "netmask": "255.255.0.0", "gateway": "10.166.255.1"}, {"route": "10.116.0.0", "netmask": "255.240.0.0", "gateway": "10.1.1.1"}], "gateway": null}

Please note that the information was modified for privacy. This is just grabbing servicenet. To gather all the vm-data use

xenstore-ls vm-data

Altogether now:

Step 1. Retrieve all vm-data


$ xenstore-ls vm-data
 user-metadata = ""
 rax_service_level_automation = ""Complete""
 build_config = """"
networking = ""
 BC764E182CB = "{"label": "private", "broadcast": "10.177.1.1", "ips": [{"ip": "10.177.1.1", "netmask": "255.255.255.0", "enabled": "1", "gateway": null}], "mac": "BC:76\..."
 BC764E0192DB = "{"ip6s": [{"ip": "2a00:1a48:7803:107:be76:4eff::", "netmask": 64, "enabled": "1", "gateway": "fg80::def"}], "label": "public", "broadcast": "37.188.117.2\..."
meta = "{"rxtx_cap": 80.0}"
auto-disk-config = "False"

Step 2. Retrieve data for Network MACID

xenstore-read vm-data/networking/BC764E182CB
"label": "private", "broadcast": "10.177.255.255", "ips": [{"ip": "10.177.1.1", "netmask": "255.255.255.0", "enabled": "1", "gateway": null}], "mac": "", "dns": ["83.138.151.81", "83.138.151.80"], "routes": [{"route": "10.1.0.0", "netmask": "255.255.255.0", "gateway": "10.177.1.1"}, {"route": "10.1.1.0", "netmask": "255.255.0.0", "gateway": "10.101.1.1"}], "gateway": null}

xenstore-read vm-data/networking/BC764E0192DB
{"ip6s": [{"ip": "2a00:1a48:7803:107:be76:4eff:fe08:9cc3", "netmask": 64, "enabled": "1", "gateway": "fe80::def"}], "label": "public", "broadcast": "37.1.117.255", "ips": [{"ip": "37.188.117.48", "netmask": "255.255.255.0", "enabled": "1", "gateway": "37.1.117.1"}], "mac": "", "gateway_v6": "ge77::def", "dns": ["83.138.151.81", "83.138.151.80"], "gateway": "37.1.117.1"}

Please note I sanitised the MACID and IP address information, altering it not to show my real ips and subnets, it is just to give you an idea of the two virtual intefaces, publicnet & servicenet.

Creating a Bootable CD of XenServer 6.2 using Mac OS X

My Colleague at work asked me to create a bootable CD of XenServer 6.2. So I thought I’d quickly throw together a tutorial on how to do this.

Step 1. Download the ISO from Xen website http://xenserver.org/open-source-virtualization-download.html

In my case I’m using the 6.2 version release. but this process is good for burning any bootable ISO

wget http://downloadns.citrix.com.edgesuite.net/8159/XenServer-6.2.0-install-cd.iso

Step 2. Convert from iso to a dmg/img

hdiutil convert -format UDRW -o xenserver6.2.img XenServer-6.2.0-install-cd.iso

Step 3. Locate USB device in my case it was /dev/disk2. My colleague was using xen 6.5 previously.

diskutil list

$ diskutil list
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *14.4 MB    disk1
   1:                  Apple_HFS MenuMeters 1.8.1        14.4 MB    disk1s1
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                            XenServer-6.5.0        *62.0 GB    disk2

Step 4. unmount the USB disk

diskutil unmountDisk /dev/disk2

Step 5. Create the USB image


sudo dd if=xenserver6.2.img.dmg of=/dev/disk2 bs=1m

563+1 records in
563+1 records out
590448640 bytes transferred in 186.928304 secs (3158690 bytes/sec)

Step 6. Eject USB device safely

diskutil eject /dev/disk2

Job done! You should now have a working bootable USB disk ISO for xen server 6.2 ready to install.

Resetting Meta data of a RAX Rackspace Xen Server

At work we had some customers complaining of metadata not being removed on their servers.


nova --os-username username --os-password apigoeshere meta uuidgoeshere delete rax:reboot_window

It was pretty simple to do as a one liner right.

But imagine we have a list.txt full of 100 servers that need clearing for an individual customer, that would be a nightmare to do manually like above. so we can do it like:

for server in $(cat list.txt); do nova --os-username username --os-password apikeygoeshere meta $server delete rax:reboot_window; done

Now that is pretty cool. And saved me and my colleagues a lot of time.