Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle Stapp RabidCicada

  • TwoSix Labs
  • D.C. Metro Area
View GitHub Profile
@RabidCicada
RabidCicada / bootstrap_local_vm.yml.patch
Last active Jun 13, 2018
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
View bootstrap_local_vm.yml.patch
--- 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 Jun 13, 2018
qemu wrapper for ovirt's libguestfish vm creation. Use with hosted_engine_custom.env in the other gist.
View qemu-wrapper.sh
#!/bin/bash -
i=0
while [ $# -gt 0 ]; do
case "$1" in
-machine)
shift 2;;
-cpu)
shift 2;;
*)
@RabidCicada
RabidCicada / watchdir.py
Created Jun 11, 2018
Recursive enabled directory watcher for directory events
View watchdir.py
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 / hosted_engine_custom.env
Last active Jun 13, 2018
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>
View hosted_engine_custom.env
export LIBGUESTFS_HV=<LOCATION OF QEMUWRAPPER>/qemu-wrapper.sh
@RabidCicada
RabidCicada / 51_nested_in_vmware
Last active Jun 13, 2018
Before running 'hosted-engine --deploy', Put this file in /usr/libexec/vdsm/hooks/before_vm_start/51_nested_in_vmware on the ovirt node
View 51_nested_in_vmware
#!/usr/bin/python
import os
import hooking
from ovirt_hosted_engine_setup import constants as ohostedcons
class NestedInVMWareHook(object):