Last active
February 10, 2021 17:30
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put this file in /usr/libexec/vdsm/hooks/before_vm_start/51_nested_in_vmware on the node machine. before running hosted_enginel --deploy.