Auto Start VM after XenServer reboot

SSH or gain command line access to XenServer

First we need to enable the Pool to allow auto starting
Second we will need to turn on the auto_poweron to true

In the following examples replace the UUIDs with your UUIDs

Find Pool UUID

You can find the pool UUID by running the “xe pool-list” Command. Note: you’ll still have a pool even if there is only a single server.

# xe pool-list
uuid ( RO) : 2e587aeb-de94-hf29-3eda-923d8he634fe

Enable auto_poweron for the pool

xe pool-param-set uuid=2e587aeb-de94-hf29-3eda-923d8he634fe other-config:auto_poweron=true

Verify that it is enabled

xe pool-param-list uuid=2e587aeb-de94-hf29-3eda-923d8he634fe  | grep auto_poweron

List VM UUID’s

Locate the UUID’s of the VM’s you want to start

# xe vm-list
uuid ( RO)           : 521be58a-3495-ea29-02a0-85ffcda06583
     name-label ( RW): CentOS 7
    power-state ( RO): running

Enable auto start

Run the following command for each VM you want to auto start. Change the UUID to the UUID of the vm you want to start.

xe pool-param-set uuid=521be58a-3495-ea29-02a0-85ffcda06583  other-config:auto_poweron=true

Print parameter settings

Use the following command to verify that the auto_poweron option is enabled.

xe vm-param-list uuid=521be58a-3495-ea29-02a0-85ffcda06583 | grep -i poweron | cut -d";" -f1

Example output

                      other-config (MRW): auto_poweron: true

https://support.citrix.com/article/CTX133910

Setup Windows File Share for Citrix XenServer

Setup Share in windows

You may need to enable the Network Sharing and discovery in the network sharing center before proceeding with the following steps.

Create a new directory, right click and hit properties.

Under Sharing, hit Advanced Sharing…

Enable the Check mark for “Share this folder” and verify the share name is correct. In this example we are sharing a folder called XenServerShare

Setup Share in XenCenter

From XenCenter, hit add new Storage Repository and run through the wizard. When you get to the Share path put in \\share-ip-address\Share\Path

Example: If the IP address of the computer with the Share is 192.168.1.2 and you shared your Downloads folder, the path would be as follows

\\192.168.1.2\Downloads

Use the share computers username and password to log in to it.

How To Reset root Password on CentOS VM – XenServer

Basic steps are as follows.

  1. Shutdown VM
  2. From XenCenter, insert the CentOS iso into the VM’s Virtual DVD drive.
  3. Boot the CentOS VM in recovery mode.  If you need help with that check this post out.
  4. On the grub menu, select recover OS Installation.
  5. Run through the recovery and mount the VM’s disk where CentOS is installed
  6. You should now be able to drop to a prompt and chroot /sysimage
  7. Change the root password with passwd
  8. Shutdown the VM
  9. Eject the CentOS iso
  10. Boot up the VM and login with the new password

XenServer Commands

List, unplug, or destroy PBD storage repository

xe pbd-list
xe pbd-unplug uuid=[UUID for VM]
xe sr-destroy uuid=[UUID for VM]

List, unplug, or destroy storage repository.

xe sr-list
xe sr-unplug uuid=[UUID for VM]
xe sr-destroy uuid=[UUID for VM]

List VM’s

xe vm-list

Shutdown VM

xe vm-shutdown uuid=[UUID for VM]

Force shutdown VM

xe vm-shutdown -–force uuid=[UUID for VM]

List Task

xe task-list

Cancel Task

xe task-cancel uuid=[task uuid]

External Links

http://www.queryadmin.com/801/useful-storage-repository-commands-xenserver/

https://www.serveroperations.net/citrix/shutdown-a-hung-vm-on-xenserver

https://linuxconfig.org/how-to-take-and-restore-vm-snapshot-using-command-line-on-xenserver

How to Boot a XenServer VM into Recovery Mode

Recovery Mode can be helpful if you need to do certain task like operate on the VM with the disk unmounted or you need to reset a root password.

All of the following is done through XenCenter

To boot the VM into recovery mode all you have to do is

  1. Shutdown the VM
  2. Insert boot media i.e. (DVD, cd, iso image, etc.) into DVD Drive 1:
  3. Start VM in Recovery Mode.  In the main menu click on VM –> Start/Shut Down –> Start in Recovery Mode

When the VM boots up it will boot off of whatever is in DVD Drive 1.

 

 

XenServer Unable to Import OVF

Check to see if you have an import template.

In the Main Menu click “View” and check “Hidden Objects”, in the Server View you should see a Template named something like “XenServer Transfer VM 6.2.0-123456c (hidden)”

If you don’t have one, then run the following command on the XenServer to create a template.

/opt/xensource/packages/files/transfer-vm/install-transfer-vm.sh

If the command fails double check that you have a default storage repository selected and try again.

Once the template is created import the OVF.