码迷,mamicode.com
首页 > 其他好文 > 详细

虚拟ipmi virtualbmc

时间:2018-04-13 17:59:31      阅读:292      评论:0      收藏:0      [点我收藏+]

标签:ipmi   bmc   virtualbmc   裸金属   

  • 安装 virtualbmc
  • yum install python-virtualenv
    virtualenv ven
    source ven/bin/activate
    pip install pip --upgrade
    
    yum install libvirt-devel gcc
    pip install virtualbmc
    • 安装libvirt kvm,创建bridge
    yum install libvirt qemu-kvm
    
    brctl addbr br0
    ifconfig br0 up
    • 为虚拟机添加bmc,domain为虚拟机在virsh中的名字
      vbmc add <domain> --port 6230 --username admin --password password
    • 开启bmc,bmc的端口监听在udp上
      vbmc start <domain>
    • 测试,virtualbmc只支持2.0协议,需要lanplus

      ipmitool -I lanplus -U admin -P 123456 -H 172.168.101.11 -p 6230 power status
      # ipmitool -I lan -H 172.168.101.11 -U root -P 123456 -p 6230 chassis power status
    • bootdev 修改libvirt 配置文件的boot节,实现从不同设备引导

      ipmitool -I lanplus -U admin -P 123456 -H 127.0.0.1 -p 6230 chassis bootdev disk
    • 使用下面的配置文件创建虚拟机
      <domain type=‘kvm‘>
      <name>a</name>
      <memory unit=‘GiB‘>1</memory>
      <currentMemory unit=‘GiB‘>1</currentMemory>
      <vcpu placement=‘static‘>1</vcpu>
      <os>
      <type arch=‘x86_64‘ machine=‘pc‘>hvm</type>
      <boot dev=‘hd‘/>
      <boot dev=‘cdrom‘/>
      <bootmenu enable=‘no‘/>
      </os>
      <features>
      <acpi/>
      <apic/>
      </features>
      <cpu mode=‘host-model‘>
        <model fallback=‘allow‘/>
      </cpu>
      <clock offset=‘utc‘>
      <timer name=‘rtc‘ tickpolicy=‘catchup‘/>
      <timer name=‘pit‘ tickpolicy=‘delay‘/>
      <timer name=‘hpet‘ present=‘no‘/>
      </clock>
      <on_poweroff>destroy</on_poweroff>
      <on_reboot>restart</on_reboot>
      <on_crash>restart</on_crash>
      <pm>
      <suspend-to-mem enabled=‘no‘/>
      <suspend-to-disk enabled=‘no‘/>
      </pm>
      <devices>
      <emulator>/usr/libexec/qemu-kvm</emulator>
      <disk type=‘file‘ device=‘disk‘>
        <driver name=‘qemu‘ type=‘qcow2‘ cache=‘writethrough‘/>
        <source file=‘/opt/vm/a.img‘/>
        <target dev=‘vda‘ bus=‘virtio‘/>
        <address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x03‘ function=‘0x0‘/>
      </disk>
      <disk type=‘file‘ device=‘cdrom‘>
        <driver name=‘qemu‘ type=‘raw‘/>
        <target dev=‘hda‘ bus=‘ide‘/>
        <readonly/>
        <address type=‘drive‘ controller=‘0‘ bus=‘0‘ target=‘0‘ unit=‘0‘/>
      </disk>
      <controller type=‘usb‘ index=‘0‘ model=‘ich9-ehci1‘>
        <address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x05‘ function=‘0x7‘/>
      </controller>
      <controller type=‘usb‘ index=‘0‘ model=‘ich9-uhci1‘>
        <master startport=‘0‘/>
        <address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x05‘ function=‘0x0‘ multifunction=‘on‘/>
      </controller>
      <controller type=‘usb‘ index=‘0‘ model=‘ich9-uhci2‘>
        <master startport=‘2‘/>
        <address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x05‘ function=‘0x1‘/>
      </controller>
      <controller type=‘usb‘ index=‘0‘ model=‘ich9-uhci3‘>
        <master startport=‘4‘/>
        <address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x05‘ function=‘0x2‘/>
      </controller>
      <controller type=‘pci‘ index=‘0‘ model=‘pci-root‘/>
      <controller type=‘ide‘ index=‘0‘>
        <address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x01‘ function=‘0x1‘/>
      </controller>
      <interface type=‘bridge‘>
        <source bridge=‘br0‘/>
        <!--
        不使用openvswitch ,删除下面两行
        -->
        <virtualport type=‘openvswitch‘> 
        </virtualport>
        <model type=‘virtio‘/>
        <address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x07‘ function=‘0x0‘/>
      </interface>
      <serial type=‘pty‘>
        <target port=‘0‘/>
      </serial>
      <console type=‘pty‘>
        <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‘>
        <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‘>
        <address type=‘pci‘ domain=‘0x0000‘ bus=‘0x00‘ slot=‘0x06‘ function=‘0x0‘/>
      </memballoon>
      </devices>
      </domain>

    虚拟ipmi virtualbmc

    标签:ipmi   bmc   virtualbmc   裸金属   

    原文地址:http://blog.51cto.com/penguintux/2103084

    (0)
    (0)
       
    举报
    评论 一句话评论(0
    登录后才能评论!
    © 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
    迷上了代码!