This script will let you make backups of live VMs running on KVM, using libvirt.
The backup job will suspend the VM for the time it takes to copy the RAM to disk.
Credits: Luca Lazzeroni
I've made some minor adjustments.
<powershell> | |
write-output "Running User Data Script" | |
write-host "(host) Running User Data Script" | |
cmd.exe /c net user /add vagrant FooBar@123 | |
cmd.exe /c net localgroup administrators vagrant /add | |
Set-ExecutionPolicy -ExecutionPolicy bypass -Force | |
# RDP |
$download_url = 'https://opscode-omnibus-packages.s3.amazonaws.com/windows/2008r2/x86_64/chef-client-11.12.4-1.windows.msi' | |
(New-Object System.Net.WebClient).DownloadFile($download_url, 'C:\\Windows\\Temp\\chef.msi') | |
Start-Process 'msiexec' -ArgumentList '/qb /i C:\\Windows\\Temp\\chef.msi' -NoNewWindow -Wait |
netsh advfirewall firewall set rule group="remote administration" new enable=yes | |
netsh advfirewall firewall add rule name="Open Port 5985" dir=in action=allow protocol=TCP localport=5985 | |
winrm quickconfig -q | |
winrm quickconfig -transport:http | |
winrm set winrm/config '@{MaxTimeoutms="7200000"}' | |
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}' | |
winrm set winrm/config/winrs '@{MaxProcessesPerShell="0"}' | |
winrm set winrm/config/winrs '@{MaxShellsPerUser="0"}' | |
winrm set winrm/config/service '@{AllowUnencrypted="true"}' |
# knife cheat | |
## Search Examples | |
knife search "name:ip*" | |
knife search "platform:ubuntu*" | |
knife search "platform:*" -a macaddress | |
knife search "platform:ubuntu*" -a uptime | |
knife search "platform:ubuntu*" -a virtualization.system | |
knife search "platform:ubuntu*" -a network.default_gateway |
############################################# | |
## | |
## PostgreSQL base backup automation | |
## Author: Stefan Prodan | |
## Date : 20 Oct 2014 | |
## Company: VeriTech.io | |
############################################# | |
# path settings | |
$BackupRoot = 'C:\Database\Backup'; |
# | |
# KMS Client Setup Keys: http://technet.microsoft.com/en-us/library/jj612867.aspx | |
# | |
#################################################################### | |
# Windows 8.1 Enterprise Evaluation ISO: | |
# @url: http://go.microsoft.com/fwlink/?LinkId=302161 | |
#################################################################### | |
<?xml version="1.0" encoding="utf-8"?> | |
<unattend xmlns="urn:schemas-microsoft-com:unattend"> | |
<settings pass="generalize"> | |
<component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<SkipRearm>1</SkipRearm> | |
</component> | |
<component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<PersistAllDeviceInstalls>false</PersistAllDeviceInstalls> | |
<DoNotCleanUpNonPresentDevices>false</DoNotCleanUpNonPresentDevices> | |
</component> |
# Problem: | |
# | |
# If you use git submodules linking two private github repos, you'll need to create a separate deploy key for each. | |
# Multiple keys are not supported by Ansible, nor does ansible (when running git module) resort to your `.ssh/config` file. | |
# This means your ansible playbook will hang in this case. | |
# | |
# You can however use the ansible git module to checkout your repo in multiple steps, like this: | |
# | |
- hosts: webserver | |
vars: |
docker rmi $(docker images -q -f dangling=true) |
This script will let you make backups of live VMs running on KVM, using libvirt.
The backup job will suspend the VM for the time it takes to copy the RAM to disk.
Credits: Luca Lazzeroni
I've made some minor adjustments.