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>

Reminder

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

upgrade

How to check the virtual machine’s port ID

Publication Date:  2012-11-16 Views:  41 Downloads:  0
Issue Description
Q:
How to check the virtual machine’s port ID?
Alarm Information
None
Handling Process
A:
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'>
  <name>i-348C070E</name>
  <uuid>2258e350-bb9d-dcc5-537c-9d0ba6df1335</uuid>
  <memory>4194304</memory>
  <currentMemory>4194304</currentMemory>
  <vcpu cpuset='3-15'>2</vcpu>
  <os>
    <type>hvm</type>
    <loader>/usr/lib/xen/boot/hvmloader</loader>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <viridian>1</viridian>
  <rtc_timeoffset>28715</rtc_timeoffset>
  <devices>
    <emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
    <disk type='block' device='disk'>
      <driver name='phy'/>
      <source dev='/dev/mapper/i-348C070E-root'/>
      <target dev='xvda' bus='xen'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='file'/>
      <source file='/usr/bin/pvdriver_upgrade/null.iso'/>
      <target dev='xvdd' bus='xen'/>
      <readonly/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='phy'/>
      <source dev='/dev/mapper/vol-492108F9-user'/>
      <target dev='xvde' bus='xen'/>
    </disk>
    <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>
    <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'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
    </serial>
    <console type='pty' tty='/dev/pts/2'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <graphics type='vnc' port='5902' autoport='yes' listen='0.0.0.0'/>
  </devices>
</domain>

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

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

END