Start Xenserver VM from cmd line

  1. Use vm-list to determine the name of the vm you want to start
    [root my-xen-server-box ~]# xe vm-list
    uuid ( RO)           : 60c1607b-1e51-bfe7-088e-a4a868b80f7f
         name-label ( RW): docker
        power-state ( RO): running
    
    
    uuid ( RO)           : 96b5c2e3-5c76-a354-74ef-c324069a7c91
         name-label ( RW): jenkins
        power-state ( RO): running
    
    
    uuid ( RO)           : e0bac120-5676-50fc-7989-c11f5cf1537d
         name-label ( RW): puppet_host1
        power-state ( RO): running
    
    
    uuid ( RO)           : cc502056-ee19-1c97-a90c-a6dfe766db67
         name-label ( RW): devops
        power-state ( RO): halted
    
    
    uuid ( RO)           : c4555386-c498-4434-8926-3a42e607aabc
         name-label ( RW): networkadmin
        power-state ( RO): running
    
    
    uuid ( RO)           : f312e45d-506e-a626-5b28-ba9a179f5524
         name-label ( RW): webserver
        power-state ( RO): halted
    
    
    uuid ( RO)           : dc50cbba-ec9f-4fba-8135-d104a4dc0c61
         name-label ( RW): Control domain on host: xenserver
        power-state ( RO): running
    
    
    uuid ( RO)           : e4177291-c3e8-8f6c-93ad-a127fe4e9b62
         name-label ( RW): puppet_host2
        power-state ( RO): running
    
    
    uuid ( RO)           : dbe265c4-a19d-8211-eb57-161359509a2c
         name-label ( RW): puppet_master
        power-state ( RO): running
    
  2. Now use the name-label to start the VM
    [root xenserver ~]# xe vm-start vm=webserver
    [root xenserver ~]#  
    

Xenserver list vms

[root my-xen-server-box ~]# xe vm-list
uuid ( RO)           : 60c1607b-1e51-bfe7-088e-a4a868b80f7f
     name-label ( RW): docker
    power-state ( RO): running


uuid ( RO)           : 96b5c2e3-5c76-a354-74ef-c324069a7c91
     name-label ( RW): jenkins
    power-state ( RO): running

...

Connect to a xen vm from xenconsole

I’m having issues ssh’ing into a XenServer VM. Therefore, I want to connect via CMD line to control a xen vm.

  1. ssh to my-xen-server-box

    ssh my-xen-server-box
  2. List your VMs & take note of the uuid’s

    [root my-xen-server-box ~]# xe vm-list
    uuid ( RO)           : 60c1607b-1e51-bfe7-088e-a4a868b80f7f
         name-label ( RW): docker
        power-state ( RO): running
    
    
    uuid ( RO)           : 96b5c2e3-5c76-a354-74ef-c324069a7c91
         name-label ( RW): jenkins
        power-state ( RO): running
    
    
    uuid ( RO)           : e0bac120-5676-50fc-7989-c11f5cf1537d
         name-label ( RW): puppet_host1
        power-state ( RO): running
    
    
    uuid ( RO)           : cc502056-ee19-1c97-a90c-a6dfe766db67
         name-label ( RW): devops
        power-state ( RO): halted
    
    
    uuid ( RO)           : c4555386-c498-4434-8926-3a42e607aabc
         name-label ( RW): networkadmin
        power-state ( RO): running
    
    
    uuid ( RO)           : f312e45d-506e-a626-5b28-ba9a179f5524
         name-label ( RW): webserver
        power-state ( RO): halted
    
    
    uuid ( RO)           : dc50cbba-ec9f-4fba-8135-d104a4dc0c61
         name-label ( RW): Control domain on host: my-xen-server-box
        power-state ( RO): running
    
    
    uuid ( RO)           : e4177291-c3e8-8f6c-93ad-a127fe4e9b62
         name-label ( RW): puppet_host2
        power-state ( RO): running
    
    
    uuid ( RO)           : dbe265c4-a19d-8211-eb57-161359509a2c
         name-label ( RW): puppet_master
        power-state ( RO): running
    
  3. List your domains. Note the uuid column.

    [root my-xen-server-box ~]# list_domains
    id |                                 uuid |  state
     0 | dc50cbba-ec9f-4fba-8135-d104a4dc0c61 |     R 
     2 | 60c1607b-1e51-bfe7-088e-a4a868b80f7f |    B  
     4 | e0bac120-5676-50fc-7989-c11f5cf1537d |    B  
     5 | e4177291-c3e8-8f6c-93ad-a127fe4e9b62 |    B  
     6 | dbe265c4-a19d-8211-eb57-161359509a2c |    B  
     7 | 96b5c2e3-5c76-a354-74ef-c324069a7c91 |    B  
     8 | c4555386-c498-4434-8926-3a42e607aabc |    B  
    
  4. Look in the uuid column for your vm’s uuid. Take note of the id column value to the left
  5. Connect to this VM via xenconsole

    [root my-xen-server-box ~]# /usr/lib/xen/bin/xenconsole 4
    
    
    Ubuntu 14.04.1 LTS puppet-host1 hvc0
    
    puppet-host1 login: username
    Password: 
    Last login: Sun Jan 18 11:24:28 PST 2015 on hvc0
    Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-44-generic x86_64)
    
     * Documentation:  https://help.ubuntu.com/
    
      System information as of Tue Jan 27 11:10:39 PST 2015
    
    
    0 packages can be updated.
    0 updates are security updates.