-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathconfig.yaml
More file actions
98 lines (85 loc) · 3.63 KB
/
Copy pathconfig.yaml
File metadata and controls
98 lines (85 loc) · 3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Configuration file for vm_autoscale
# Global thresholds for scaling VMs
scaling_thresholds:
cpu:
high: 80 # Percentage CPU usage at which scaling up is triggered
low: 20 # Percentage CPU usage at which scaling down is considered
ram:
high: 85 # Percentage RAM usage at which scaling up is triggered
low: 25 # Percentage RAM usage at which scaling down is considered
# Scaling limits for VMs
scaling_limits:
min_cores: 1 # Minimum number of CPU cores that a VM can have
max_cores: 8 # Maximum number of CPU cores that a VM can have
min_ram_mb: 1024 # Minimum RAM (in MB) that a VM can have (updated since NUMA doesn't like less than 1024MB)
max_ram_mb: 16384 # Maximum RAM (in MB) that a VM can have
# Time intervals for checking VM resources and performing actions (in seconds)
check_interval: 300 # How often to check VM stats and take action if needed
# List of Proxmox hosts to manage
proxmox_hosts:
- name: host1
host: 192.168.1.10
ssh_user: root
ssh_password: your_password_here # SSH password or key must be provided
ssh_key: /path/to/ssh_key # Path to SSH private key (optional, use if no password)
ssh_port: 22 # SSH Port (default 22)
- name: host2
host: 192.168.1.11
ssh_user: root
ssh_password: your_password_here
ssh_key: /path/to/ssh_key
# Virtual machines to be monitored and scaled
virtual_machines:
- vm_id: "101"
proxmox_host: "host1"
scaling_enabled: true
cpu_scaling: true # Enable/disable CPU scaling
ram_scaling: true # Enable/disable RAM scaling
thresholds:
cpu_high: 80
cpu_low: 20
ram_high: 80
ram_low: 20
- vm_id: 102
proxmox_host: host2
scaling_enabled: true
cpu_scaling: true
ram_scaling: true
thresholds:
cpu_high: 80
cpu_low: 20
ram_high: 80
ram_low: 20
# Logging configuration
logging:
level: INFO # Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
log_file: /var/log/vm_autoscale.log # Path to the log file
# Alerts configuration (Optional)
alerts:
email_enabled: false
email_recipient: admin@example.com
smtp_server: smtp.example.com
smtp_port: 587
smtp_user: your_smtp_user
smtp_password: your_smtp_password
# Gotify notifications configuration (Optional)
gotify:
enabled: false
server_url: https://gotify.example.com # Base URL of the Gotify server
app_token: your_gotify_app_token_here # Application token for authentication
priority: 5 # Notification priority level (1-10)
# Safety checks for host resource limits
host_limits:
max_host_cpu_percent: 90 # Max CPU usage percentage for the host before scaling is restricted
max_host_ram_percent: 90 # Max RAM usage percentage for the host before scaling is restricted
# Hotplug auto-configuration
auto_configure_hotplug: true # Automatically enable hotplug and NUMA on VMs for live scaling
# Billing configuration (Optional) - for tracking autoscaled resource usage
billing:
enabled: false # Enable billing tracking
billing_period_days: 30 # Length of billing period in days
cost_per_cpu_core_per_hour: 0.01 # Cost per CPU core per hour
cost_per_gb_ram_per_hour: 0.005 # Cost per GB RAM per hour
csv_output_dir: /var/log/vm_autoscale/billing/ # Directory for billing CSV reports
webhook_script: "" # Optional: path to script to run with billing data
webhook_url: "" # Optional: POST billing data to this URL