Package: vbmc4vsphere
VirtualBMC for vSphere (vbmc4vsphere)⚠️IMPORTANT UPDATES⚠️Since0.1.0, the commands have been renamed tovsbmcandvsbmcdto allow coexistence with the original VirtualBMC. Also, the path to the configuration files has been changed.To migrate your old configuration files, please refer tothe migration guide on the GitHub Wiki page.Table of ContentsOverviewDisclaimerInstallationvSphere PermissionsSupported IPMI commandsArchitectureQuick StartInstallationStart DaemonConfigure VirtualBMCServer SimulationTipsOptional configuration fileManage stored data manuallyUse in large-scale vSphere deploymentsUse with Nested-ESXi and vCenter ServerUse with Nested-KVM and oVirtUse with OpenShift Bare Metal IPIReference resourcesOverviewA virtual BMC for controlling virtual machines using IPMI commands for the VMware vSphere environment.In other words, this is the VMware vSphere version ofVirtualBMCpart of the OpenStack project.This can be used as a BMC of Nested-ESXi, thereforeyou can make the vSphere DPM work in your nested environmentfor testing purpose.See:📖The guide to use with Nested-ESXi and vCenter Server.📖The guide to use with Nested-KVM and oVirt.📖The guide to use with OpenShift Bare Metal IPI.DisclaimerFor testing purposes only. Not for production use.The vCenter Server credentials including password are stored in plain text.The vSphere DPM can be enabled with VirtualBMC for vSphere, but be careful with the recommendations presented in the vSphere DPM in nested environments may not be accurate or meet expectations.See the wiki page for detail.Installationpython-mpipinstallvbmc4vsphereIf you want to run VirtualBMC for vSphere in Docker container,see the guide on wiki page.vSphere PermissionsThe following are the minimum permissions needed on vSphere for VirtualBMC for vSphere (queried usinggovc).VirtualMachine.Config.Settings
VirtualMachine.Interact.PowerOff
VirtualMachine.Interact.PowerOn
VirtualMachine.Interact.Reset
Global.DiagnosticsSupported IPMI commands# Power the virtual machine on, off, graceful off, reset, and NMI.# Note that NMI is currently experimental.ipmitool-Ilanplus-Uadmin-Ppassword-H192.168.0.1-p6230poweron|off|soft|reset|diag# Check the power status.ipmitool-Ilanplus-Uadmin-Ppassword-H192.168.0.1-p6230powerstatus# Set the boot device to network, disk or cdrom.ipmitool-Ilanplus-Uadmin-Ppassword-H192.168.0.1-p6230chassisbootdevpxe|disk|cdrom# Get the current boot device.ipmitool-Ilanplus-Uadmin-Ppassword-H192.168.0.1-p6230chassisbootparamget5# Get the channel info. Note that its output is always a dummy, not actual information.ipmitool-Ilanplus-Uadmin-Ppassword-H192.168.0.1-p6230channelinfo# Get the network info. Note that its output is always a dummy, not actual information.ipmitool-Ilanplus-Uadmin-Ppassword-H192.168.0.1-p6230lanprint1Experimental support:power diagThe command returns a response immediately, but the virtual machine receives NMI60 seconds later. This depends on the behavior ofdebug-hung-vmon the ESXi.ArchitectureQuick StartInstall VirtualBMC for vSphere on some linux host, startvsbmcddaemon, and then configure throughvsbmccommand.Installationpython-mpipinstallvbmc4vsphereStart DaemonStart daemon:vsbmcdBy default, daemon starts in background. You can start it in foreground by--foregroundoption to get logs.vsbmcd--foregroundConfigure VirtualBMCIn order to see all command options supported by thevsbmctool do:vsbmc--helpIt’s also possible to list the options from a specific command. For example, in order to know what can be provided as part of theaddcommand do:vsbmcadd--helpAdding a new virtual BMC to control VM called lab-vesxi01:vsbmcaddlab-vesxi01--port6230--viserver192.168.0.1--viserver-usernamevsbmc@vsphere.local--viserver-passwordmy-secure-passwordBinding a network port number below 1025 is restricted and only users with privilege will be able to start a virtual BMC on those ports.Passing the credential for your vCenter Server is required.By default, IPMI credential is configured asadminandpassword. You can specify your own username and password by--usernameand--passwordat this time.Adding a additional virtual BMC to control VM called lab-vesxi02:vsbmcaddlab-vesxi02--port6231--viserver192.168.0.1--viserver-usernamevsbmc@vsphere.local--viserver-passwordmy-secure-passwordSpecify a different port for each virtual machine.Starting the virtual BMC to control VMs:vsbmcstartlab-vesxi01
vsbmcstartlab-vesxi02Getting the list of virtual BMCs including their VM name and IPMI network endpoints they are reachable at:$vsbmclist
+-------------+---------+---------+------+|VMname|Status|Address|Port|+-------------+---------+---------+------+|lab-vesxi01|running|::|6230||lab-vesxi02|running|::|6231|+-------------+---------+---------+------+To view configuration information for a specific virtual BMC:$vsbmcshowlab-vesxi01
+-------------------+---------------------+|Property|Value|+-------------------+---------------------+|active|False||address|::||password|***||port|6230||status|running||username|admin||viserver|192.168.0.1||viserver_password|***||viserver_username|vsbmc@vsphere.local||vm_name|lab-vesxi01||vm_uuid|None|+-------------------+---------------------+Stopping the virtual BMC:vsbmcstoplab-vesxi01
vsbmcstoplab-vesxi02Server SimulationOnce the virtual BMC for a specific VM has been created and started you can then issue IPMI commands against the address and port of that virtual BMC to control the VM.In this example, if your VirtualBMC host has192.168.0.100, you can control:lab-vesxi01through192.168.0.100:6230lab-vesxi02through192.168.0.100:6231by using IPMI. For example:To power on the virtual machinelab-vesxi01:$ipmitool-Ilanplus-H192.168.0.100-p6230-Uadmin-Ppasswordchassispoweron
ChassisPowerControl:Up/OnTo check its power status:$ipmitool-Ilanplus-H192.168.0.100-p6230-Uadmin-Ppasswordchassispowerstatus
ChassisPowerisonTo shutdownlab-vesxi01:$ipmitool-Ilanplus-H192.168.0.100-p6230-Uadmin-Ppasswordchassispowersoft
ChassisPowerControl:SoftTo reset thelab-vesxi02:$ipmitool-Ilanplus-H192.168.0.100-p6231-Uadmin-Ppasswordchassispowerreset
ChassisPowerControl:ResetTipsOptional configuration fileBothvsbmcdandvsbmccan make use of an optional configuration file, which is looked for in the following locations (in this order):VBMC4VSPHERE_CONFIGenvironment variable pointing to a file$HOME/.vsbmc/vbmc4vsphere.conffile/etc/vbmc4vsphere/vbmc4vsphere.conffileIf no configuration file has been found, the internal defaults apply.The configuration files are not created automatically unless you create them manually. And even if you don't create a configuration file, it won't matter in most cases.Below is a sample ofvbmc4vsphere.conf.[default]#show_passwords = falseconfig_dir=/home/vsbmc/.vsbmc#pid_file = /home/vsbmc/.vsbmc/master.pid#server_port = 50891#server_response_timeout = 5000#server_spawn_wait = 3000[log]# logfile = /home/vsbmc/.vsbmc/log/vbmc4vsphere.logdebug=true[ipmi]session_timeout=10Manage stored data manuallyOnce you invokevsbmc addcommand, everything that you specified will be stored asconfigfile per virtual machine under$HOME/.vsbmc/by default. There files can be used backup/restoration, migration, and of course can be managed by any kind of configuration management tools. Please noteeverything including password stored in plain textin theseconfigfile.The path for these files can be changed byconfig_dirin yourvbmc4vsphere.confdescribed above.$cat~/.vsbmc/lab-vesxi01/config[VirtualBMC]username=adminpassword=passwordaddress=::port=6230vm_name=lab-vesxi01vm_uuid=903a0dfb-68d1-4d2e-9674-10e353a733caviserver=192.168.0.1viserver_username=vsbmc@vsphere.localviserver_password=my-secure-passwordactive=TrueUse in large-scale vSphere deploymentsYou can use UUID instead of name to identify virtual machine by specifying--vm-uuidoption invsbmc addcommand. This makes response time for IPMI command faster in large-scale vSphere deployments with a large number of virtual machines.vsbmcaddlab-vesxi01\--vm-uuid903a0dfb-68d1-4d2e-9674-10e353a733ca\--port6230\--viserver192.168.0.1\--viserver-usernamevsbmc@vsphere.local\--viserver-passwordmy-secure-passwordThe UUID for virtual machines can be gathered in various ways likegovcandPowerCLI.# Get UUID by govc$govcvm.infolab-vesxi01
Name:lab-vesxi01...UUID:903a0dfb-68d1-4d2e-9674-10e353a733ca...# Get UUID by PowerCLI>(Get-VMlab-vesxi01).ExtensionData.Config.Uuid903a0dfb-68d1-4d2e-9674-10e353a733caUse with Nested-ESXi and vCenter ServerIn the vCenter Server, by using VirtualBMC for vSphere (0.0.3or later),you can enable the vSphere DPM: Distributed Power Management featurefor Nested-ESXi host that is running in your VMware vSphere environment.So you can achieve:Power-On the virtual ESXi in the same way as for physical ESXi.Automated power on/off control of ESXi hosts based on the load of the host cluster by vCenter Server.See 📖the guide on GitHub Wiki page to use with Nested-ESXi and vCenter Server.Use with Nested-KVM and oVirtIn the oVirt, by using VirtualBMC for vSphere, you can enable the Power Management feature for Nested-KVM that is running in your vSphere environment.See 📖the guide on GitHub Wiki page to use with Nested-KVM and oVirt.Use with OpenShift Bare Metal IPIWith VirtualBMC for vSphere, you can control your virtual machines in the same way as a physical server. This means that tasks that require a physical BMC can be done in a virtual environment.One such example is the provisioning of a physical server.Here's how to automatically provision OpenShift to a physical server, called Bare Metal IPI, using a virtual machine in vSphere environment with VirtualBMC for vSphere.See 📖the guide to GitHub Wiki page to use with OpenShift Bare Metal IPI.Reference resourcesThis project is started based on the copy ofVirtualBMC 2.1.0.devand customized to support the VMware vSphere environment instead of the OpenStack.Original VirtualBMC documentation (for OpenStack):https://docs.openstack.org/virtualbmc/latestIts source:https://opendev.org/openstack/virtualbmc