Instance 启动过程详解

一 查看虚拟机命令
[root@localhost ~]# virsh list --all
Id    Name                           State
----------------------------------------------------
1     instance-00000001              running
二 虚拟机配置文件查看
[root@localhost ~]# virsh edit 1
<domain type='qemu'>
  <name>instance-00000001</name>                      //虚拟机名字
  <uuid>8f492746-d49e-4fde-b87e-4cde2d4d1782</uuid>          //虚拟机uuid
  <metadata>
    <nova:instance xmlns:nova="http://openstack.org/xmlns/libvirt/nova/1.0">;
      <nova:package version="15.1.0-1.el7"/>
      <nova:name>instance1</nova:name>
      <nova:creationTime>2018-03-18 02:55:33</nova:creationTime>
      <nova:flavor name="m1.tiny">
        <nova:memory>512</nova:memory>
        <nova:disk>1</nova:disk>
        <nova:swap>0</nova:swap>
        <nova:ephemeral>0</nova:ephemeral>
        <nova:vcpus>1</nova:vcpus>
      </nova:flavor>
      <nova:owner>
        <nova:user uuid="7ed4ce59626941478efb08c37cad526e">demo</nova:user>
        <nova:project uuid="b38c09cb0b5a4d46820c66052bb0ee94">demo</nova:project>
      </nova:owner>
    </nova:instance>
  </metadata>
  <memory unit='KiB'>524288</memory>                //虚拟机内存
  <currentMemory unit='KiB'>524288</currentMemory>    //虚拟机内存
  <vcpu placement='static'>1</vcpu>          //虚拟机CPU
  <cputune>
    <shares>1024</shares>
  </cputune>
<sysinfo type='smbios'>
    <system>
      <entry name='manufacturer'>RDO</entry>
      <entry name='product'>OpenStack Compute</entry>
      <entry name='version'>15.1.0-1.el7</entry>
      <entry name='serial'>69622dce-ad6c-4c40-8378-f3a512cacec8</entry>
      <entry name='uuid'>8f492746-d49e-4fde-b87e-4cde2d4d1782</entry>
      <entry name='family'>Virtual Machine</entry>
    </system>
  </sysinfo>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.4.0'>hvm</type>
    <boot dev='hd'/>
    <smbios mode='sysinfo'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu>
    <topology sockets='1' cores='1' threads='1'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
<devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/disk/by-path/ip-192.168.0.120:3260-iscsi-iqn.2010-10.org.openstack:volume-8110a566-0e03-45c4-960b-f82162f5e554-lun-0'/>
      <target dev='vda' bus='virtio'/>
      <serial>8110a566-0e03-45c4-960b-f82162f5e554</serial>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <controller type='usb' index='0' model='piix3-uhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <interface type='bridge'>             //虚拟机的网卡描述
      <mac address='fa:16:3e:60:27:b1'/>
      <source bridge='qbr745a0cde-34'/>
      <target dev='tap745a0cde-34'/>
      <model type='virtio'/>
      <driver name='qemu'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>              //虚拟机输入日志位置
      <log file='/var/lib/nova/instances/8f492746-d49e-4fde-b87e-4cde2d4d1782/console.log' append='off'/>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <log file='/var/lib/nova/instances/8f492746-d49e-4fde-b87e-4cde2d4d1782/console.log' append='off'/>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <stats period='10'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>
三 显示虚拟机对应的端口号
[root@localhost ~]# virsh vncdisplay 1
:0
四 虚拟机保存位置
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值