Skip to content

Instantly share code, notes, and snippets.

View RabidCicada's full-sized avatar

Kyle Stapp RabidCicada

  • TwoSix Labs
  • D.C. Metro Area
View GitHub Profile
@RabidCicada
RabidCicada / watchdir.py
Created June 11, 2018 18:47
Recursive enabled directory watcher for directory events
import logging
import sys
import inotify.adapters
_DEFAULT_LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
_LOGGER = logging.getLogger(__name__)
def _configure_logging():
@RabidCicada
RabidCicada / bootstrap_local_vm.yml.patch
Last active June 13, 2018 17:42
Before running 'hosted-engine --deploy', Patch /usr/share/ovirt-hosted-engine-setup/ansible/bootstrap_local_vm.yml similar to below to add --machine pc-i440fx-rhel7.2.0
--- bootstrap_local_vm.yml 2018-04-26 18:19:12.000000000 -0400
+++ bootstrap_local_vm.yml.new 2018-04-27 10:58:01.000000000 -0400
@@ -138,7 +138,7 @@
environment: "{{ CMD_LANG }}"
changed_when: True
- name: Create local VM
- command: virt-install -n {{ VM_NAME }}Local --os-variant rhel7 --virt-type kvm --memory {{ MEM_SIZE }} --vcpus {{ VCPUS }} --network network=default,mac={{ VM_MAC_ADDR }},model=virtio --disk {{ local_vm_disk_path }} --import --disk path={{ LOCAL_VM_DIR }}/seed.iso,device=cdrom --noautoconsole --rng /dev/random --graphics vnc --video vga --sound none --controller usb,model=none --memballoon none --boot hd,menu=off --clock kvmclock_present=yes
+ command: virt-install -n {{ VM_NAME }}Local --machine pc-i440fx-rhel7.2.0 --os-variant rhel7 --virt-type kvm --memory {{ MEM_SIZE }} --vcpus {{ VCPUS }} --network network=default,mac={{ VM_MAC_ADDR }},model=virtio --disk {{ local_vm_disk_path }} --import --disk path={{ LOCAL_VM_DIR }}/seed.iso,device=cdrom --
@RabidCicada
RabidCicada / qemu-wrapper.sh
Last active June 13, 2018 17:44
qemu wrapper for ovirt's libguestfish vm creation. Use with hosted_engine_custom.env in the other gist.
#!/bin/bash -
i=0
while [ $# -gt 0 ]; do
case "$1" in
-machine)
shift 2;;
-cpu)
shift 2;;
*)
@RabidCicada
RabidCicada / hosted_engine_custom.env
Last active February 10, 2021 17:29
Before running 'hosted-engine --deploy', Put this in /etc/ovirt-hosted-engine-setup.env.d/hosted-engine-custom.env. Edit to replace <LOCATION OF QEMUWRAPPER>
export LIBGUESTFS_HV=<LOCATION OF QEMUWRAPPER>/qemu-wrapper.sh
@RabidCicada
RabidCicada / 51_nested_in_vmware
Last active February 10, 2021 17:30
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):