Richard Parmiter

Virtualisation blog and Knowledge Base

  • You are here: 
  • Home

Netscaler cannot boot with message “Can’t load Kernel” after failed firmware upgrade

Posted on January 16th, 2013

Came across this tricky problem today at a client site with some old and unsupported Netscaler devices.

Customer had a failed Netscaler 7000 appliance in an HA pair and got it replaced by Citrix. However, their working Netscaler was running version 8.1 build 56.11 and they wanted to downgrade the firmware on the new appliance to the same version before re-establishing the HA. However the issue experienced would have also occurred for any firmware upgrade as well as downgrade.

For reference the replacement NS7000 had version 9.3 build 56.5cl and eventually was successfully downgraded to v8.1 build 56.11

The following was performed after taking a backup of the replacement netscaler:

  • Located the firmware on the working Netscaler in the /var/nsinstall folder
  • Used WinSCP to copy this locally
  • Copied the firmware to the /var/nsinstall folder on the replacement Netscaler
  • The firmware had already been un-tar’ed in the folder so the firmware and documentation was already available for selection
  • Using the GUI, ran through the upgrade firmware wizard
  • This failed due to a lack of space on the flash drive
  • Rebooted the Netscaler (just to be sure before trying again)

The Netscaler failed to boot.

The blue LCD screen on the front of the device only momentarily showed “booting” and then turned off.

Fortunately I had a Netscaler console cable available, and this was connected to a laptop in the following order:

  • Laptop –> USB to serial cable –> Netscaler serial console cable –> RJ45 to Serial adapter –> Netscaler console port

This enabled me to open a console session to the netscaler using a Putty serial connection (9600, 8, 1, none, none).

the console was displaying a failed boot stating:

can’t load ‘kernel’
can’t load ‘kernel.old’
can’t load ‘kernel.work’
no bootable kernel

It seemed that in the process of the failed firmware upgrade the flash boot disk was amended and the kernel was deleted.

The Citrix forum post (http://forums.citrix.com/thread.jspa?threadID=96524) states that F4 can be pressed during boot to enable boot device selection, and indeed a list was shown for:

1 Netscaler

5 Drive 1

Default: 1

But no matter which keys were pressed, it always attempted to boot from the flash disk.

I eventually resolved this by the following work around at the OK prompt:

set currdev=disk1s1a:

load disk1s1a:/kernel

This is detailed in Citrix forum (http://forums.citrix.com/thread.jspa?threadID=290421) and then boots the Netscaler from the Hard disk. It is then possible to copy the missing kernel back to the flash drive (from the backup made before starting. I made a backup in /var)

cp /var/kernel.gz /flash

Rebooting the device then boots from the kernel on the flash drive as normal – so problem solved!

However, I still needed to downgrade the firmware so this time ran the ./nsinstall command from the cli but again failed due to lack of space. So, copied the /flash/.recovery/hd.recovery.gz file locally and removed from the netscaler. Then performed the firmware installation and said NO to the reboot and manually copied that file back again.

I also manually checked the /flash folder for the new firmware .gz file and it was there as expected.

On rebooting the Netscaler it correctly booted, but didn’t set the NSIP correctly, instead defaulting to the 192.168.100.1 address. Using the console i set NSIP and rebooted again:

  • set ns config -ipaddress x.x.x.x -netmask y.y.y.y     (note x=NSIP & y=netmask)
  • add ns ip z.z.z.z y.y.y.y -type MIP   (note z=MIP IP Address, y=Subnet mask)
  • save ns config
  • reboot

After this final reboot the IP was set correctly and the device was running v8.1 build 56.11 cl as expected.

Hope this helps someone as it took me ages to sort this out!

 

Filed under Citrix Netscaler | No Comments »

Add VMs to vCenter from an unknown datastore

Posted on October 17th, 2012

Sometimes it may be required to add VMs to vCenter from a recovered or new datastore. This can be performed manually by adding a new VM and browsing the datastore to attach the disk from the .vmdk file or adding the .vmx files.

However, for datastores that contain many virtual machines, this is laborious and time consuming and it is beneficial to script this where possible.

A script to do this is as follows:

$Cluster = “vCenter Cluster Name”
$Datastores = “vSphere Datastore Name”
$VMFolder = “VM Folder Name”
$ESXHost = Get-Cluster $Cluster | Get-VMHost | select -First 1

foreach($Datastore in Get-Datastore $Datastores) {
# Set up Search for .VMX Files in Datastore
$ds = Get-Datastore -Name $Datastore | %{Get-View $_.Id}
$SearchSpec = New-Object VMware.Vim.HostDatastoreBrowserSearchSpec
$SearchSpec.matchpattern = “*.vmx”
$dsBrowser = Get-View $ds.browser
$DatastorePath = “[" + $ds.Summary.Name + "]”

# Find all .VMX file paths in Datastore, filtering out ones with .snapshot (Useful for NetApp NFS)
$SearchResult = $dsBrowser.SearchDatastoreSubFolders($DatastorePath, $SearchSpec) | where {$_.FolderPath -notmatch “.snapshot”} | %{$_.FolderPath + ($_.File | select Path).Path}

#Register all .vmx Files as VMs on the datastore
foreach($VMXFile in $SearchResult) {
New-VM -VMFilePath $VMXFile -VMHost $ESXHost -Location $Folder -RunAsync
}
}

It is also a useful script if replicating virtual machines to backup storage for DR purposes. If you ever need to use the backup storage, simply attach it to the vSphere cluster and run the script to quickly add all the VM’s that reside on it.

Ref: I found this script on the following blog: Wood IT Work

Tags: , , , ,
Filed under Scripts/Reg, VMWare | No Comments »

Determine vCenter display name from within the VM

Posted on October 17th, 2012

There may be situations where you want to determine the vCenter diaply name for a VM from within the OS of the VM.

This could be useful if cloning multiple virtual desktops from a syspreped template to enable the option to set the machine name to be the same as the vCenter display name. It could also be useful in many other scenarios.

However, by default there is no way to do this using the standard VM tools that are instaled into the virtual machine.

It is possible though to set a custom attribute on the VM object in vCenter and then query this from within the the OS of the virtual machine.

The following script can be run using the vSphere PowerCLI to set a custom attribute to be the same as the vCenter display name:

$vServer= “vCenter.server.fqdn”
$vmName = “VM display name”

If (-not (Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) {
Add-PSSnapin VMware.VimAutomation.Core
}

Connect-VIServer $vServer | out-null

$vmSet = GET-VM $vmName | Get-View
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$gInfo = New-Object VMware.Vim.optionvalue
$ginfo.Key=”guestinfo.hostname”
$gInfo.Value=$vmSet.Name
$vmConfigSpec.extraconfig += $gInfo
$vmSet.ReconfigVM($vmConfigSpec)

Disconnect-VIServer $vServer -Confirm:$false | out-null

Once this is set, it is possible to query it within the VM, using the VM tools and the following command:

vmtoolsd.exe –cmd “info-get guestinfo.hostname”

This can of course, be added to scripts to set this attribute against multiple machines.

Tags: , , , ,
Filed under Scripts/Reg, VMWare | 1 Comment »

Citrix Recevier for iPad shows “Error” but Reciever for Android works

Posted on February 21st, 2012

Came across  this interesting problem today.

Users connecting to a XenApp deployment via a Netscaler 9.3 & CAG Enterprise Edition using the Citrix receiver for iPad and Android. Web Interface for Netscaler was used to provide the XenApp services site.

The Android receiver worked as expected but the iPhone/iPad receiver did not enumerate the apps. On the creation of a new connection, the following errors were shown:

  • iPhone: There are no applications available at this time
  • iPad: Error

After much messing about, it seems that when creating a XenApp service site on the Netscaler, a checkbox is provided stating “enable connection through mobile receiver”. When this is selected a few “rewrite” rules are created to resolve a problem with the iPad/iPhone receiver connections but the rewrite feature is not enabled at the same time on the Netscaler. Simply right clicking the “rewrite” menu in the left panel and selecting to enable the feature is enough to resolve the problem.

After doing this, all mobile receivers can connect as expected.

 

 

Tags: , , , , , , , , , , , , , , ,
Filed under Citrix Access Gateway, Citrix Netscaler | No Comments »

Impersonate other browsers with Chrome

Posted on February 16th, 2012

When testing access scenarios it is useful to impersonate other browers such as Safari or Mobile Safari from a Windows PC. This can be done with Chrome using the following syntax when launching the app. This example impersonates the mobile safari browser on an iPhone.

chrome.exe –user-agent=”Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543 Safari/419.3″

There are many “user-agent” strings that can be added to this syntax and a google search should discover the correct one required.

This is particularly useful if testing Netscaler configurations where different web pages appear for different browser types.

Tags: , , , , , , , , , , , ,
Filed under Applications | No Comments »