Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Before running 'hosted-engine --deploy', Put this file in /usr/libexec/vdsm/hooks/before_vm_start/51_nested_in_vmware on the ovirt node
#!/usr/bin/python
import os
import hooking
from ovirt_hosted_engine_setup import constants as ohostedcons
class NestedInVMWareHook(object):
def __init__(self):
super(NestedInVMWareHook, self).__init__()
self.config = {}
self.domxml = hooking.read_domxml()
def save(self):
hooking.write_domxml(self.domxml)
def set_custom_machine_type(self):
os_element = self.domxml.getElementsByTagName('os')[0]
os_type_element = os_element.getElementsByTagName('type')[0]
machine_attr=os_type_element.setAttribute('machine', 'pc-i440fx-rhel7.2.0')
def main(self):
self.set_custom_machine_type()
self.save()
if __name__ == "__main__":
NestedInVMWareHook().main()
# vim: expandtab tabstop=4 shiftwidth=4
@RabidCicada

This comment has been minimized.

Copy link
Owner Author

@RabidCicada RabidCicada commented Jun 11, 2018

Put this file in /usr/libexec/vdsm/hooks/before_vm_start/51_nested_in_vmware on the node machine. before running hosted_enginel --deploy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.