No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search


To have a better experience, please upgrade your IE browser.


How to check the virtual machine’s port ID

Publication Date:  2012-11-16 Views:  99 Downloads:  0
Issue Description
How to check the virtual machine’s port ID?
Alarm Information
Handling Process
1. Login in the OMS portal, and obtain the virtual machine’s ID;
2. Login in the CNA where the virtual machine on via the putty;
3. Use the command “xm li” to check this node’s virtual machines, and confirm the above virtual machine is on this CNA node;
4. Use the command: virsh dumpxml “the virtual machine ID” to check the virtual machine port’s ID.
For example:
We want to check the port ID of the virtual machine i-348C070E, execute “xm li” on the CNA node to check the virtual machine is on this CNA node:
CNA01:~ # xm li
Name                                            ID                Mem            VCPUs           State   Time(s)
Domain-0                                      0               4043                   3                    r----- 853915.5
i-348C070E                                  18             4096                   2                   -b----   7834.3
i-374206E7                                  37              4096                   2                   -b----    370.9
i-408D0861                                  25              4096                   2                   -b----  32832.0
i-4F9A08BB                                  24              4096                   2                   -b----   7985.0
i-58A90A12                                  38              1024                    1                   -b----    533.6

We can confirm that the virtual machine is on this CNA node, so we execute the command: virsh dumpxml i-348C070E, and then we get the following outcome:

CNA01:~ # virsh dumpxml  i-348C070E
<domain type='xen' id='18'>
  <vcpu cpuset='3-15'>2</vcpu>
    <boot dev='hd'/>
  <clock offset='utc'/>
    <disk type='block' device='disk'>
      <driver name='phy'/>
      <source dev='/dev/mapper/i-348C070E-root'/>
      <target dev='xvda' bus='xen'/>
    <disk type='file' device='cdrom'>
      <driver name='file'/>
      <source file='/usr/bin/pvdriver_upgrade/null.iso'/>
      <target dev='xvdd' bus='xen'/>
    <disk type='block' device='disk'>
      <driver name='phy'/>
      <source dev='/dev/mapper/vol-492108F9-user'/>
      <target dev='xvde' bus='xen'/>
    <interface type='bridge'>
      <mac address='28:6e:d4:88:b2:cb'/>
      <source bridge='br3532'/>
      <script path='/etc/xen/scripts/vif-bridge'/>
      <target dev='vif18.0'/>
    <interface type='bridge'>
      <mac address='28:6e:d4:88:b2:cc'/>
      <source bridge='br4097'/>
      <script path='/etc/xen/scripts/vif-bridge'/>
      <target dev='vif18.1'/>
    <serial type='pty'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
    <console type='pty' tty='/dev/pts/2'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
    <input type='tablet' bus='usb'/>
    <graphics type='vnc' port='5902' autoport='yes' listen=''/>

Where, 5902 is the virtual machine’s port ID.

Root Cause
The above operation is usually used to locate the problem while we can’t login in the virtual machine via the OMS portal.