Skip to content

Instantly share code, notes, and snippets.

@RabidCicada
Last active February 10, 2021 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save RabidCicada/40655db1582ca5d07c9bbf2c429cdd01 to your computer and use it in GitHub Desktop.
Save RabidCicada/40655db1582ca5d07c9bbf2c429cdd01 to your computer and use it in GitHub Desktop.
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
Copy link
Author

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