For check if the VM on XenServer have Auto-run configured, do this…
Check your VM List with this instruction:
# xe vm-list
For list the advanced options for one VM, do:
# xe vm-params-list uuid=[uuid-VM)
Enable auto-power on at XenServer…
# xe pool-list
# xe pool-param-list
ENABLE: xe pool-paran-set uuid=UUID POOL other-config:auto_poweron=true
# xe pool-param-list
Now is momento for actívate auto-run on VMs:
# xe vm-params-set uuid=[uuid-VM] other-config:auto_poweron=true
and check if is correct configurated:
# xe vm-params-list uuid[uuid-VM]
Others way to do this…
XenServer is based on CentOS OS. Like a Linux SO, have all advantatges that permit Linux SO. Linux, has a file called /etc/rc.local which runs at the end of all the multi-user boot levels, and which you can therefore put stuff in
You can call a script on rc.local to run intructions on startup, or you can créate a Start Script for run intructions on diferents init levels.
For do this, you can do, for exemple…
Create a script with Vim…
# vim run_start_vm.sh
And create the script with next lines:
#!/bin/bash
export PATH=/opt/xensource/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
sleep 30
xe vm-start uuid=<uuid_VM_ForStart>
sleep 15
xe vm-start uuid=<uuid_VM_ForStart>
sleep 15
…
Save and exit, and put permisions for run this script:
# chmod 777 run_start_vm.sh
And call the script from rc.local. Edit rc.local on etc/rc.d and call with complete Path the Script for run VMs.
NOTE: This last information is only informative and is not the best method for do this. Use the XE command for do. Other information is only with educative.
UPDATE: On XS6.0 You don’t need do this. Use vApp for auto-run VMs on the environment.
Leave a Reply