mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-20 16:03:06 +01:00
sync hypervisor state remote to local
This commit is contained in:
0
salt/hypervisor/defaults.brainstorm.yaml
Normal file
0
salt/hypervisor/defaults.brainstorm.yaml
Normal file
@@ -1,79 +0,0 @@
|
|||||||
hypervisor:
|
|
||||||
nodes:
|
|
||||||
jpphype1:
|
|
||||||
add_guest: []
|
|
||||||
guests:
|
|
||||||
- sen1_sensor:
|
|
||||||
cpu: 2
|
|
||||||
mem: 8192
|
|
||||||
|
|
||||||
jpphype1:
|
|
||||||
guests:
|
|
||||||
sen1_sensor:
|
|
||||||
hardware:
|
|
||||||
cpu: 2
|
|
||||||
mem: 8192
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
models:
|
|
||||||
model1:
|
|
||||||
hardware:
|
|
||||||
cpu:
|
|
||||||
total: 128
|
|
||||||
free: 128
|
|
||||||
memory:
|
|
||||||
total: 128
|
|
||||||
free: 128
|
|
||||||
disks:
|
|
||||||
free:
|
|
||||||
3: pci_0000_c7_00_0
|
|
||||||
4: pci_0000_c8_00_0
|
|
||||||
claimed:
|
|
||||||
1: pci_0000_c5_00_0
|
|
||||||
2: pci_0000_c6_00_0
|
|
||||||
copper:
|
|
||||||
free:
|
|
||||||
1: pci_0000_c4_00_0
|
|
||||||
2: pci_0000_c4_00_1
|
|
||||||
3: pci_0000_c4_00_2
|
|
||||||
4: pci_0000_c4_00_3
|
|
||||||
claimed: {}
|
|
||||||
sfp:
|
|
||||||
free:
|
|
||||||
5: pci_0000_41_00_0
|
|
||||||
6: pci_0000_41_00_1
|
|
||||||
claimed: {}
|
|
||||||
model2:
|
|
||||||
hardware:
|
|
||||||
cpu:
|
|
||||||
total: 128
|
|
||||||
free: 128
|
|
||||||
memory:
|
|
||||||
total: 512
|
|
||||||
free: 512
|
|
||||||
disks:
|
|
||||||
free:
|
|
||||||
3: pci_0000_c8_00_0
|
|
||||||
4: pci_0000_c9_00_0
|
|
||||||
5: pci_0000_c10_00_0
|
|
||||||
6: pci_0000_c11_00_0
|
|
||||||
claimed:
|
|
||||||
1: pci_0000_c6_00_0
|
|
||||||
2: pci_0000_c7_00_0
|
|
||||||
copper:
|
|
||||||
free:
|
|
||||||
1: pci_0000_c4_00_0
|
|
||||||
2: pci_0000_c4_00_1
|
|
||||||
3: pci_0000_c4_00_2
|
|
||||||
4: pci_0000_c4_00_3
|
|
||||||
5: pci_0000_c5_00_0
|
|
||||||
6: pci_0000_c5_00_1
|
|
||||||
7: pci_0000_c5_00_2
|
|
||||||
8: pci_0000_c5_00_3
|
|
||||||
claimed: {}
|
|
||||||
sfp:
|
|
||||||
free:
|
|
||||||
9: pci_0000_41_00_0
|
|
||||||
10: pci_0000_41_00_1
|
|
||||||
claimed: {}
|
|
||||||
62
salt/hypervisor/defaults.yaml
Normal file
62
salt/hypervisor/defaults.yaml
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
hypervisor:
|
||||||
|
nodes: []
|
||||||
|
model1:
|
||||||
|
hardware:
|
||||||
|
cpu:
|
||||||
|
total: 128
|
||||||
|
free: 128
|
||||||
|
memory:
|
||||||
|
total: 128
|
||||||
|
free: 128
|
||||||
|
disks:
|
||||||
|
free:
|
||||||
|
3: pci_0000_c7_00_0
|
||||||
|
4: pci_0000_c8_00_0
|
||||||
|
claimed:
|
||||||
|
1: pci_0000_c5_00_0
|
||||||
|
2: pci_0000_c6_00_0
|
||||||
|
copper:
|
||||||
|
free:
|
||||||
|
1: pci_0000_c4_00_0
|
||||||
|
2: pci_0000_c4_00_1
|
||||||
|
3: pci_0000_c4_00_2
|
||||||
|
4: pci_0000_c4_00_3
|
||||||
|
claimed: {}
|
||||||
|
sfp:
|
||||||
|
free:
|
||||||
|
5: pci_0000_41_00_0
|
||||||
|
6: pci_0000_41_00_1
|
||||||
|
claimed: {}
|
||||||
|
model2:
|
||||||
|
hardware:
|
||||||
|
cpu:
|
||||||
|
total: 128
|
||||||
|
free: 128
|
||||||
|
memory:
|
||||||
|
total: 512
|
||||||
|
free: 512
|
||||||
|
disks:
|
||||||
|
free:
|
||||||
|
3: pci_0000_c8_00_0
|
||||||
|
4: pci_0000_c9_00_0
|
||||||
|
5: pci_0000_c10_00_0
|
||||||
|
6: pci_0000_c11_00_0
|
||||||
|
claimed:
|
||||||
|
1: pci_0000_c6_00_0
|
||||||
|
2: pci_0000_c7_00_0
|
||||||
|
copper:
|
||||||
|
free:
|
||||||
|
1: pci_0000_c4_00_0
|
||||||
|
2: pci_0000_c4_00_1
|
||||||
|
3: pci_0000_c4_00_2
|
||||||
|
4: pci_0000_c4_00_3
|
||||||
|
5: pci_0000_c5_00_0
|
||||||
|
6: pci_0000_c5_00_1
|
||||||
|
7: pci_0000_c5_00_2
|
||||||
|
8: pci_0000_c5_00_3
|
||||||
|
claimed: {}
|
||||||
|
sfp:
|
||||||
|
free:
|
||||||
|
9: pci_0000_41_00_0
|
||||||
|
10: pci_0000_41_00_1
|
||||||
|
claimed: {}
|
||||||
@@ -1,35 +1,15 @@
|
|||||||
|
# This is the start of an example of what this file will look like. It will be generated by Salt, so this yaml file is not used by Salt.
|
||||||
hypervisor:
|
hypervisor:
|
||||||
hosts:
|
hosts:
|
||||||
defaultHost:
|
jpphype1:
|
||||||
add_guest:
|
add_searchnode:
|
||||||
description: List of hypervisor nodes.
|
description: Add a new searchnode to the hypervisor.
|
||||||
forcedType: "[]string"
|
file: true
|
||||||
global: True
|
global: true
|
||||||
multiline: True
|
multiline: true
|
||||||
guests:
|
add_sensor:
|
||||||
defaultGuest:
|
description: Add a new sensor to the hypervisor.
|
||||||
copper:
|
file: true
|
||||||
description: Copper nics
|
global: true
|
||||||
forcedType: "[]int"
|
multiline: true
|
||||||
global: True
|
guests: {}
|
||||||
multiline: True
|
|
||||||
sfp:
|
|
||||||
description: sfp nics
|
|
||||||
forcedType: "[]int"
|
|
||||||
global: True
|
|
||||||
multiline: True
|
|
||||||
disks:
|
|
||||||
description: disk
|
|
||||||
forcedType: "[]int"
|
|
||||||
global: True
|
|
||||||
multiline: True
|
|
||||||
cpu:
|
|
||||||
description: cpu
|
|
||||||
forcedType: int
|
|
||||||
global: True
|
|
||||||
multiline: True
|
|
||||||
memory:
|
|
||||||
description: mem
|
|
||||||
forcedType: int
|
|
||||||
global: True
|
|
||||||
multiline: True
|
|
||||||
|
|||||||
@@ -101,6 +101,14 @@ def redefine_vm(conn, new_xml_desc, logger):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
# Set up logging using the so_logging_utils library
|
||||||
|
logger = setup_logging(
|
||||||
|
logger_name='so-kvm-modify-hardware',
|
||||||
|
log_file_path='/opt/so/log/hypervisor/so-kvm-modify-hardware.log',
|
||||||
|
log_level=logging.INFO,
|
||||||
|
format_str='%(asctime)s - %(levelname)s - %(message)s'
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
args = parse_arguments()
|
args = parse_arguments()
|
||||||
|
|
||||||
@@ -110,14 +118,6 @@ def main():
|
|||||||
pci_id = args.pci
|
pci_id = args.pci
|
||||||
start_vm_flag = args.start
|
start_vm_flag = args.start
|
||||||
|
|
||||||
# Set up logging using the so_logging_utils library
|
|
||||||
logger = setup_logging(
|
|
||||||
logger_name='so-kvm-modify-hardware',
|
|
||||||
log_file_path='/opt/so/log/hypervisor/so-kvm-modify-hardware.log',
|
|
||||||
log_level=logging.INFO,
|
|
||||||
format_str='%(asctime)s - %(levelname)s - %(message)s'
|
|
||||||
)
|
|
||||||
|
|
||||||
# Connect to libvirt
|
# Connect to libvirt
|
||||||
try:
|
try:
|
||||||
conn = libvirt.open(None)
|
conn = libvirt.open(None)
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ Usage:
|
|||||||
python so-qcow2-modify-network.py -I <qcow2_image_path> -i <interface> (--dhcp4 | --static4 --ip4 <ip_address> --gw4 <gateway>) [--dns4 <dns_servers>] [--search4 <search_domain>]
|
python so-qcow2-modify-network.py -I <qcow2_image_path> -i <interface> (--dhcp4 | --static4 --ip4 <ip_address> --gw4 <gateway>) [--dns4 <dns_servers>] [--search4 <search_domain>]
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
python so-qcow2-modify-network.py -I path_to_image -i eth0 --static4 --ip4 192.168.1.10/24 --gw4 192.168.1.1 --dns4 192.168.1.1,8.8.8.8 --search4 example.local
|
python so-qcow2-modify-network.py -I /var/lib/libvirt/images/coreol9/coreol9.qcow2 -i eth0 --static4 --ip4 192.168.1.10/24 --gw4 192.168.1.1 --dns4 192.168.1.1,8.8.8.8 --search4 example.local
|
||||||
|
|
||||||
python so-qcow2-modify-network.py -I path_to_image -i eth0 --dhcp4
|
python so-qcow2-modify-network.py -I /var/lib/libvirt/images/coreol9/coreol9.qcow2 -i eth0 --dhcp4
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
@@ -161,14 +161,14 @@ def parse_arguments():
|
|||||||
return args
|
return args
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
# Set up logging using the so_logging_utils library
|
||||||
|
logger = setup_logging(
|
||||||
|
logger_name='so-qcow2-modify-network',
|
||||||
|
log_file_path='/opt/so/log/hypervisor/so-qcow2-modify-network.log',
|
||||||
|
log_level=logging.INFO,
|
||||||
|
format_str='%(asctime)s - %(levelname)s - %(message)s'
|
||||||
|
)
|
||||||
try:
|
try:
|
||||||
# Set up logging using the so_logging_utils library
|
|
||||||
logger = setup_logging(
|
|
||||||
logger_name='so-qcow2-modify-network',
|
|
||||||
log_file_path='/opt/so/log/hypervisor/so-qcow2-modify-network.log',
|
|
||||||
log_level=logging.INFO,
|
|
||||||
format_str='%(asctime)s - %(levelname)s - %(message)s'
|
|
||||||
)
|
|
||||||
args = parse_arguments()
|
args = parse_arguments()
|
||||||
|
|
||||||
validate_interface_name(args.interface)
|
validate_interface_name(args.interface)
|
||||||
|
|||||||
Reference in New Issue
Block a user