vdsm:获取虚拟机详细信息getInfo

  1. 获取所有的虚拟机信息

[root@p0 ~]# vdsm-client Host getVMList
[
    "a6b12b3d-7ec0-48df-8ee6-d0c12a2207cc", 
    "ff664a8c-5cd4-4b24-a2b0-848d0cc5973f", 
    "7f3c9d4b-f898-4b81-9650-1d400c6d7416", 
    "b491aaef-698c-4b9e-8110-23f4d604d9be", 
    "9c175232-1fb0-4e6f-87ba-8d26cee38cdb"
]
  1. 通过uuid查询虚拟机详细信息

通过以下信息,耐心阅读之后就会大致了解云内的虚拟机的基本参数,以及基于kvm构建出来的虚拟机的参数配置方式。

[root@p0 ~]# vdsm-client VM getInfo vmID="9c175232-1fb0-4e6f-87ba-8d26cee38cdb"
{
    "acpiEnable": "true", 
    "emulatedMachine": "pc-i44xxxxl7.6.0", 
    "tabletEnable": "true", 
    "vmId": "9c175232-1fb0-4e6f-87ba-8d26cee38cdb", 
    "memGuaranteedSize": 1024, 
    "timeOffset": "0", 
    "cpuType": "Haswell-noTSX", 
    "smp": "4", 
    "guestNumaNodes": [
        {
            "nodeIndex": 0, 
            "cpus": "0,1,2,3", 
            "memory": "8192"
        }
    ], 
    "xml": "<?xml version='1.0' encoding='UTF-8'?>\n<domain xmlns:ovirt-tune=\"http://ovirt.org/vm/tune/1.0\" xmlns:ovirt-vm=\"http://ovirt.org/vm/1.0\" type=\"kvm\"><name>HostedEngine</name><uuid>9c175232-1fb0-4e6f-87ba-8d26cee38cdb</uuid><memory>8388608</memory><currentMemory>8388608</currentMemory><iothreads>1</iothreads><maxMemory slots=\"16\">33554432</maxMemory><vcpu current=\"4\">64</vcpu><sysinfo type=\"smbios\"><system><entry name=\"manufacturer\">oVirt</entry><entry name=\"product\">OS-NAME:</entry><entry name=\"version\">OS-VERSION:</entry><entry name=\"serial\">HOST-SERIAL:</entry><entry name=\"uuid\">9c175232-1fb0-4e6f-87ba-8d26cee38cdb</entry></system></sysinfo><clock offset=\"variable\" adjustment=\"0\"><timer name=\"rtc\" tickpolicy=\"catchup\"/><timer name=\"pit\" tickpolicy=\"delay\"/><timer name=\"hpet\" present=\"no\"/></clock><features><acpi/></features><cpu match=\"exact\"><model>Haswell-noTSX</model><topology cores=\"4\" threads=\"1\" sockets=\"16\"/><numa><cell id=\"0\" cpus=\"0,1,2,3\" memory=\"8388608\"/></numa></cpu><cputune/><devices><input type=\"tablet\" bus=\"usb\"/><channel type=\"unix\"><target type=\"virtio\" name=\"ovirt-guest-agent.0\"/><source mode=\"bind\" path=\"/var/lib/libvirt/qemu/channels/9c175232-1fb0-4e6f-87ba-8d26cee38cdb.ovirt-guest-agent.0\"/></channel><channel type=\"unix\"><target type=\"virtio\" name=\"org.qemu.guest_agent.0\"/><source mode=\"bind\" path=\"/var/lib/libvirt/qemu/channels/9c175232-1fb0-4e6f-87ba-8d26cee38cdb.org.qemu.guest_agent.0\"/></channel><graphics type=\"spice\" port=\"-1\" autoport=\"yes\" passwd=\"*****\" passwdValidTo=\"1970-01-01T00:00:01\" tlsPort=\"-1\"><channel name=\"main\" mode=\"secure\"/><channel name=\"inputs\" mode=\"secure\"/><channel name=\"cursor\" mode=\"secure\"/><channel name=\"playback\" mode=\"secure\"/><channel name=\"record\" mode=\"secure\"/><channel name=\"display\" mode=\"secure\"/><channel name=\"smartcard\" mode=\"secure\"/><channel name=\"usbredir\" mode=\"secure\"/><listen type=\"network\" network=\"vdsm-ovirtmgmt\"/></graphics><graphics type=\"vnc\" port=\"-1\" autoport=\"yes\" passwd=\"*****\" passwdValidTo=\"1970-01-01T00:00:01\" keymap=\"en-us\"><listen type=\"network\" network=\"vdsm-ovirtmgmt\"/></graphics><controller type=\"usb\" model=\"piix3-uhci\" index=\"0\"><address bus=\"0x00\" domain=\"0x0000\" function=\"0x2\" slot=\"0x01\" type=\"pci\"/></controller><controller type=\"scsi\" model=\"virtio-scsi\" index=\"0\"><driver iothread=\"1\"/><alias name=\"ua-31a61d19-6265-448b-b1cc-415375e88408\"/><address bus=\"0x00\" domain=\"0x0000\" function=\"0x0\" slot=\"0x05\" type=\"pci\"/></controller><memballoon model=\"virtio\"><stats period=\"5\"/><alias name=\"ua-67a7f3b6-5ebe-4c3a-9426-b1711bc963f7\"/><address bus=\"0x00\" domain=\"0x0000\" function=\"0x0\" slot=\"0x08\" type=\"pci\"/></memballoon><sound model=\"ich6\"><alias name=\"ua-8caa6c2d-ca55-435e-9b7f-e7b718068ce8\"/><address bus=\"0x00\" domain=\"0x0000\" function=\"0x0\" slot=\"0x04\" type=\"pci\"/></sound><controller type=\"ide\" index=\"0\"><address bus=\"0x00\" domain=\"0x0000\" function=\"0x1\" slot=\"0x01\" type=\"pci\"/></controller><console type=\"unix\"><source path=\"/var/run/ovirt-vmconsole-console/9c175232-1fb0-4e6f-87ba-8d26cee38cdb.sock\" mode=\"bind\"/><target type=\"serial\" port=\"0\"/><alias name=\"ua-d5a442ed-c95a-4d01-a41f-da64f3ff8147\"/></console><rng model=\"virtio\"><backend model=\"random\">/dev/urandom</backend><alias name=\"ua-d9e1ff4b-507c-4b59-99bb-49bf5a661eab\"/></rng><video><model type=\"qxl\" vram=\"32768\" heads=\"1\" ram=\"65536\" vgamem=\"16384\"/><alias name=\"ua-de55b863-a637-4bb8-a449-e3b5d1815ff8\"/><address bus=\"0x00\" domain=\"0x0000\" function=\"0x0\" slot=\"0x02\" type=\"pci\"/></video><controller type=\"virtio-serial\" index=\"0\" ports=\"16\"><alias name=\"ua-e26d4b79-c5ae-49a2-8a91-c62346ed120c\"/><address bus=\"0x00\" domain=\"0x0000\" function=\"0x0\" slot=\"0x06\" type=\"pci\"/></controller><serial type=\"unix\"><source path=\"/var/run/ovirt-vmconsole-console/9c175232-1fb0-4e6f-87ba-8d26cee38cdb.sock\" mode=\"bind\"/><target port=\"0\"/></serial><channel type=\"spicevmc\"><target type=\"virtio\" name=\"com.redhat.spice.0\"/></channel><interface type=\"bridge\"><model type=\"virtio\"/><link state=\"up\"/><source bridge=\"ovirtmgmt\"/><driver queues=\"4\" name=\"vhost\"/><alias name=\"ua-d526015e-5fdb-4aa5-8ba9-c249ecdd0471\"/><address bus=\"0x00\" domain=\"0x0000\" function=\"0x0\" slot=\"0x03\" type=\"pci\"/><mac address=\"00:16:3e:02:05:a8\"/><mtu size=\"1500\"/><filterref filter=\"vdsm-no-mac-spoofing\"/><bandwidth/></interface><disk type=\"file\" device=\"cdrom\" snapshot=\"no\"><driver name=\"qemu\" type=\"raw\" error_policy=\"report\"/><source file=\"\" startupPolicy=\"optional\"><seclabel model=\"dac\" type=\"none\" relabel=\"no\"/></source><target dev=\"hdc\" bus=\"ide\"/><readonly/><alias name=\"ua-b250f9de-2aab-44a9-a694-ec70ec5d3840\"/><address bus=\"1\" controller=\"0\" unit=\"0\" type=\"drive\" target=\"0\"/></disk><disk snapshot=\"no\" type=\"file\" device=\"disk\"><target dev=\"vda\" bus=\"virtio\"/><source file=\"/rhev/data-center/00000000-0000-0000-0000-000000000000/f59228c0-651b-435b-bf62-e28f539a34ba/images/af103ec1-7dc0-4a87-9753-21ca4286613d/4715efff-bbfd-4b9d-8412-47bbb326eb54\"><seclabel model=\"dac\" type=\"none\" relabel=\"no\"/></source><driver name=\"qemu\" iothread=\"1\" io=\"threads\" type=\"raw\" error_policy=\"stop\" cache=\"none\"/><alias name=\"ua-af103ec1-7dc0-4a87-9753-21ca4286613d\"/><address bus=\"0x00\" domain=\"0x0000\" function=\"0x0\" slot=\"0x07\" type=\"pci\"/><serial>af103ec1-7dc0-4a87-9753-21ca4286613d</serial></disk><lease><key>4715efff-bbfd-4b9d-8412-47bbb326eb54</key><lockspace>f59228c0-651b-435b-bf62-e28f539a34ba</lockspace><target offset=\"LEASE-OFFSET:4715efff-bbfd-4b9d-8412-47bbb326eb54:f59228c0-651b-435b-bf62-e28f539a34ba\" path=\"LEASE-PATH:4715efff-bbfd-4b9d-8412-47bbb326eb54:f59228c0-651b-435b-bf62-e28f539a34ba\"/></lease></devices><pm><suspend-to-disk enabled=\"no\"/><suspend-to-mem enabled=\"no\"/></pm><os><type arch=\"x86_64\" machine=\"pc-i440fx-rhel7.6.0\">hvm</type><smbios mode=\"sysinfo\"/><bios useserial=\"yes\"/></os><metadata><ovirt-tune:qos/><ovirt-vm:vm><ovirt-vm:minGuaranteedMemoryMb type=\"int\">1024</ovirt-vm:minGuaranteedMemoryMb><ovirt-vm:clusterVersion>4.3</ovirt-vm:clusterVersion><ovirt-vm:custom/><ovirt-vm:device mac_address=\"00:16:3e:02:05:a8\"><ovirt-vm:custom/></ovirt-vm:device><ovirt-vm:device devtype=\"disk\" name=\"vda\"><ovirt-vm:poolID>00000000-0000-0000-0000-000000000000</ovirt-vm:poolID><ovirt-vm:volumeID>4715efff-bbfd-4b9d-8412-47bbb326eb54</ovirt-vm:volumeID><ovirt-vm:shared>exclusive</ovirt-vm:shared><ovirt-vm:imageID>af103ec1-7dc0-4a87-9753-21ca4286613d</ovirt-vm:imageID><ovirt-vm:domainID>f59228c0-651b-435b-bf62-e28f539a34ba</ovirt-vm:domainID></ovirt-vm:device><ovirt-vm:launchPaused>false</ovirt-vm:launchPaused><ovirt-vm:resumeBehavior>auto_resume</ovirt-vm:resumeBehavior></ovirt-vm:vm></metadata></domain>", 
    "custom": {}, 
    "smpCoresPerSocket": "4", 
    "vmName": "HostedEngine", 
    "status": "Up", 
    "maxMemSize": 32768, 
    "bootMenuEnable": "false", 
    "numOfIoThreads": "1", 
    "smpThreadsPerCore": "1", 
    "guestDiskMapping": {
        "af103ec1-7dc0-4a87-9": {
            "name": "/dev/vda2"
        }, 
        "QEMU_DVD-ROM_QM00003": {
            "name": "/dev/sr0"
        }
    }, 
    "arch": "x86_64", 
    "kvmEnable": "true", 
    "devices": [
        {
            "index": 2, 
            "iface": "ide", 
            "name": "hdc", 
            "vm_custom": {}, 
            "format": "raw", 
            "vmid": "9c175232-1fb0-4e6f-87ba-8d26cee38cdb", 
            "diskType": "file", 
            "alias": "ua-b250f9de-2aab-44a9-a694-ec70ec5d3840", 
            "readonly": "True", 
            "propagateErrors": "report", 
            "address": {
                "bus": "1", 
                "controller": "0", 
                "type": "drive", 
                "target": "0", 
                "unit": "0"
            }, 
            "device": "cdrom", 
            "discard": false, 
            "path": "", 
            "specParams": {}, 
            "type": "disk"
        }, 
        {
            "address": {
                "slot": "0x07", 
                "bus": "0x00", 
                "domain": "0x0000", 
                "type": "pci", 
                "function": "0x0"
            }, 
            "volumeInfo": {
                "path": "/rhev/data-center/mnt/172.16.72.100:_data_images_nfs1/f59228c0-651b-435b-bf62-e28f539a34ba/images/af103ec1-7dc0-4a87-9753-21ca4286613d/4715efff-bbfd-4b9d-8412-47bbb326eb54", 
                "type": "file"
            }, 
            "serial": "af103ec1-7dc0-4a87-9753-21ca4286613d", 
            "index": 0, 
            "iface": "virtio", 
            "apparentsize": "62277025792", 
            "alias": "ua-af103ec1-7dc0-4a87-9753-21ca4286613d", 
            "cache": "none", 
            "imageID": "af103ec1-7dc0-4a87-9753-21ca4286613d", 
            "readonly": "False", 
            "shared": "exclusive", 
            "truesize": "4785074176", 
            "type": "disk", 
            "domainID": "f59228c0-651b-435b-bf62-e28f539a34ba", 
            "reqsize": "0", 
            "format": "raw", 
            "poolID": "00000000-0000-0000-0000-000000000000", 
            "device": "disk", 
            "path": "/var/run/vdsm/storage/f59228c0-651b-435b-bf62-e28f539a34ba/af103ec1-7dc0-4a87-9753-21ca4286613d/4715efff-bbfd-4b9d-8412-47bbb326eb54", 
            "propagateErrors": "off", 
            "name": "vda", 
            "vm_custom": {}, 
            "vmid": "9c175232-1fb0-4e6f-87ba-8d26cee38cdb", 
            "volumeID": "4715efff-bbfd-4b9d-8412-47bbb326eb54", 
            "diskType": "file", 
            "specParams": {
                "pinToIoThread": "1"
            }, 
            "discard": false, 
            "volumeChain": [
                {
                    "domainID": "f59228c0-651b-435b-bf62-e28f539a34ba", 
                    "leaseOffset": 0, 
                    "volumeID": "4715efff-bbfd-4b9d-8412-47bbb326eb54", 
                    "leasePath": "/rhev/data-center/mnt/172.16.72.100:_data_images_nfs1/f59228c0-651b-435b-bf62-e28f539a34ba/images/af103ec1-7dc0-4a87-9753-21ca4286613d/4715efff-bbfd-4b9d-8412-47bbb326eb54.lease", 
                    "imageID": "af103ec1-7dc0-4a87-9753-21ca4286613d", 
                    "path": "/rhev/data-center/mnt/172.16.72.100:_data_images_nfs1/f59228c0-651b-435b-bf62-e28f539a34ba/images/af103ec1-7dc0-4a87-9753-21ca4286613d/4715efff-bbfd-4b9d-8412-47bbb326eb54"
                }
            ]
        }, 
        {
            "device": "ich6", 
            "alias": "ua-8caa6c2d-ca55-435e-9b7f-e7b718068ce8", 
            "type": "sound", 
            "address": {
                "function": "0x0", 
                "bus": "0x00", 
                "domain": "0x0000", 
                "type": "pci", 
                "slot": "0x04"
            }
        }, 
        {
            "device": "console", 
            "alias": "ua-d5a442ed-c95a-4d01-a41f-da64f3ff8147", 
            "type": "console", 
            "specParams": {
                "consoleType": "serial", 
                "enableSocket": true
            }
        }, 
        {
            "device": "memballoon", 
            "alias": "ua-67a7f3b6-5ebe-4c3a-9426-b1711bc963f7", 
            "specParams": {
                "model": "virtio"
            }, 
            "type": "balloon", 
            "address": {
                "function": "0x0", 
                "bus": "0x00", 
                "domain": "0x0000", 
                "type": "pci", 
                "slot": "0x08"
            }
        }, 
        {
            "device": "spice", 
            "tlsPort": "-1", 
            "type": "graphics", 
            "port": "-1", 
            "specParams": {
                "fileTransferEnable": true, 
                "copyPasteEnable": true, 
                "displayIp": "172.16.72.100", 
                "displayNetwork": "ovirtmgmt"
            }
        }, 
        {
            "device": "vnc", 
            "specParams": {
                "fileTransferEnable": true, 
                "copyPasteEnable": true, 
                "keyMap": "en-us", 
                "displayIp": "172.16.72.100", 
                "displayNetwork": "ovirtmgmt"
            }, 
            "type": "graphics", 
            "port": "-1"
        }, 
        {
            "device": "virtio", 
            "specParams": {
                "source": "urandom"
            }, 
            "model": "virtio", 
            "type": "rng", 
            "alias": "ua-d9e1ff4b-507c-4b59-99bb-49bf5a661eab"
        }, 
        {
            "device": "usb", 
            "index": "0", 
            "model": "piix3-uhci", 
            "type": "controller", 
            "address": {
                "function": "0x2", 
                "bus": "0x00", 
                "domain": "0x0000", 
                "type": "pci", 
                "slot": "0x01"
            }
        }, 
        {
            "index": "0", 
            "specParams": {
                "ioThreadId": "1"
            }, 
            "alias": "ua-31a61d19-6265-448b-b1cc-415375e88408", 
            "address": {
                "function": "0x0", 
                "bus": "0x00", 
                "domain": "0x0000", 
                "type": "pci", 
                "slot": "0x05"
            }, 
            "device": "scsi", 
            "model": "virtio-scsi", 
            "type": "controller"
        }, 
        {
            "device": "ide", 
            "index": "0", 
            "type": "controller", 
            "address": {
                "function": "0x1", 
                "bus": "0x00", 
                "domain": "0x0000", 
                "type": "pci", 
                "slot": "0x01"
            }
        }, 
        {
            "index": "0", 
            "alias": "ua-e26d4b79-c5ae-49a2-8a91-c62346ed120c", 
            "address": {
                "function": "0x0", 
                "bus": "0x00", 
                "domain": "0x0000", 
                "type": "pci", 
                "slot": "0x06"
            }, 
            "device": "virtio-serial", 
            "type": "controller", 
            "ports": "16"
        }, 
        {
            "nicModel": "pv", 
            "macAddr": "00:16:3e:02:05:a8", 
            "linkActive": true, 
            "network": "ovirtmgmt", 
            "filterParameters": [], 
            "alias": "ua-d526015e-5fdb-4aa5-8ba9-c249ecdd0471", 
            "custom": {
                "queues": "4"
            }, 
            "filter": "vdsm-no-mac-spoofing", 
            "specParams": {}, 
            "address": {
                "function": "0x0", 
                "bus": "0x00", 
                "domain": "0x0000", 
                "type": "pci", 
                "slot": "0x03"
            }, 
            "device": "bridge", 
            "mtu": 1500, 
            "type": "interface"
        }, 
        {
            "device": "qxl", 
            "alias": "ua-de55b863-a637-4bb8-a449-e3b5d1815ff8", 
            "address": {
                "function": "0x0", 
                "bus": "0x00", 
                "domain": "0x0000", 
                "type": "pci", 
                "slot": "0x02"
            }, 
            "type": "video", 
            "specParams": {
                "vram": "32768", 
                "vgamem": "16384", 
                "heads": "1", 
                "ram": "65536"
            }
        }, 
        {
            "lease_id": "4715efff-bbfd-4b9d-8412-47bbb326eb54", 
            "sd_id": "f59228c0-651b-435b-bf62-e28f539a34ba", 
            "offset": "LEASE-OFFSET:4715efff-bbfd-4b9d-8412-47bbb326eb54:f59228c0-651b-435b-bf62-e28f539a34ba", 
            "device": "lease", 
            "path": "LEASE-PATH:4715efff-bbfd-4b9d-8412-47bbb326eb54:f59228c0-651b-435b-bf62-e28f539a34ba", 
            "type": "lease"
        }
    ], 
    "maxVCpus": "64", 
    "statusTime": "4556192690", 
    "maxMemSlots": 16
}

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

千码君2016

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值