Home » Virtualization » How to create virtual machine from cli on Xenserver

How to create virtual machine from cli on Xenserver

This tutorial will describe how to create virtual machine on XenServer (6.2.0)
Virtual machine based on template.

#xe template-list

After selecting template, create VM:

#xe vm-install template=”CentOS 6.0 (64-bit) (prod)” new-name-label=”webserverVM”

Template Name= CentOS 6.0 (64-bit) (prod)
VM name=webserVM
Disable boot from VM hard disk:

#xe vbd-list vm-uuid=a1e91ab3-964a-0426-9667-5c6c36b35431 userdevice=0
#xe vbd-param-set uuid=a1e91ab3-964a-0426-9667-5c6c36b35431 bootable=false

Select boot disk for VM

#xe cd-list
#xe vm-cd-add vm=”webserverVM” cd-name=”centos-xx.iso” device=3
#xe vbd-list vm-name-label=”webserverVM” userdevice=3
#xe vbd-param-set uuid=a1e91ab3-964a-0426-9667-5c6c36b35431 bootable=true
#xe vm-param-set uuid=a1e91ab3-964a-0426-9667-5c6c36b35431 other-config:install-repository=cdrom

list network interface on host.

#xe network-list

add physical network interface to VM:

#xe vif-create vm-uuid=a1e91ab3-964a-0426-9667-5c6c36b35431 network-uuid=a1e91ab3-964a-0426-9667-5c6c36b35431 mac=”[new mac address]” device=0

Start VM:

#xe vm-start vm=webserverVM


I am founder and webmaster of www.linuxpcfix.com and working as a Sr. Linux Administrator (Expertise on Linux/Unix & Cloud Server) and have been in the industry from last 7 years.

Leave a Reply

Your email address will not be published. Required fields are marked *


Time limit is exhausted. Please reload the CAPTCHA.

Categorized Tag Cloud