diff --git a/Lifecycle-Virtual/HyperV-LifeCycle-CreateAndDestroy/stub b/Lifecycle-Virtual/HyperV-LifeCycle-CreateAndDestroy/stub new file mode 100644 index 0000000..f0b8111 --- /dev/null +++ b/Lifecycle-Virtual/HyperV-LifeCycle-CreateAndDestroy/stub @@ -0,0 +1 @@ +Merge hyperv code from monolith \ No newline at end of file diff --git a/Lifecycle-Virtual/HyperV-LifeCycle-PowerMgmt/stub b/Lifecycle-Virtual/HyperV-LifeCycle-PowerMgmt/stub new file mode 100644 index 0000000..fe9b50f --- /dev/null +++ b/Lifecycle-Virtual/HyperV-LifeCycle-PowerMgmt/stub @@ -0,0 +1 @@ +Merge Hyperv-V code from monolith \ No newline at end of file diff --git a/Lifecycle-Virtual/KVM-LifeCycle-PowerMgmt/kvm-PowerCycle.sh b/Lifecycle-Virtual/KVM-LifeCycle-PowerMgmt/kvm-PowerCycle.sh new file mode 100644 index 0000000..5cb212f --- /dev/null +++ b/Lifecycle-Virtual/KVM-LifeCycle-PowerMgmt/kvm-PowerCycle.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +VMHOSTFULL="$1" +USER_SUPPLIED_VMNAME="$2" +SSH_ALIAS="ssh -q" + +VIRSH_ALIAS="virsh -c qemu+ssh://root@$VMHOSTFULL/system?no_verify=1" + + + +$VIRSH_ALIAS destroy $USER_SUPPLIED_VMNAME +$VIRSH_ALIAS start $USER_SUPPLIED_VMNAME \ No newline at end of file diff --git a/Lifecycle-Virtual/KVM-LifeCycle-PowerMgmt/kvm-PowerOff.sh b/Lifecycle-Virtual/KVM-LifeCycle-PowerMgmt/kvm-PowerOff.sh new file mode 100644 index 0000000..cec39f7 --- /dev/null +++ b/Lifecycle-Virtual/KVM-LifeCycle-PowerMgmt/kvm-PowerOff.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +VMHOSTFULL="$1" +USER_SUPPLIED_VMNAME="$2" +SSH_ALIAS="ssh -q" + +VIRSH_ALIAS="virsh -c qemu+ssh://root@$VMHOSTFULL/system?no_verify=1" + + + +$VIRSH_ALIAS destroy $USER_SUPPLIED_VMNAME \ No newline at end of file diff --git a/Lifecycle-Virtual/KVM-LifeCycle-PowerMgmt/kvm-PowerOn.sh b/Lifecycle-Virtual/KVM-LifeCycle-PowerMgmt/kvm-PowerOn.sh new file mode 100644 index 0000000..93462d5 --- /dev/null +++ b/Lifecycle-Virtual/KVM-LifeCycle-PowerMgmt/kvm-PowerOn.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +VMHOSTFULL="$1" +USER_SUPPLIED_VMNAME="$2" +SSH_ALIAS="ssh -q" + +VIRSH_ALIAS="virsh -c qemu+ssh://root@$VMHOSTFULL/system?no_verify=1" + + +$VIRSH_ALIAS start $USER_SUPPLIED_VMNAME \ No newline at end of file diff --git a/Lifecycle-Virtual/VmWare-LifeCycle-CreateAndDestroy/esxi-delete.ps1 b/Lifecycle-Virtual/VmWare-LifeCycle-CreateAndDestroy/esxi-delete.ps1 new file mode 100644 index 0000000..84e304d --- /dev/null +++ b/Lifecycle-Virtual/VmWare-LifeCycle-CreateAndDestroy/esxi-delete.ps1 @@ -0,0 +1,11 @@ +param( +[string]$vcenter, +[string]$vm, +[string]$un, +[string]$pw +) + +Get-Module -ListAvailable PowerCLI* | Import-Module -Verbose:$false > /dev/null +Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false > /dev/null +Connect-ViServer -Server $vcenter -User "$un" -Password "$pw" -Verbose:$false > /dev/null +Remove-VM -VM $vm -DeleteFromDisk -Confirm:$false -Verbose:$false > /dev/null \ No newline at end of file diff --git a/Lifecycle-Virtual/VmWare-LifeCycle-CreateAndDestroy/esxi-resource-limit.ps1 b/Lifecycle-Virtual/VmWare-LifeCycle-CreateAndDestroy/esxi-resource-limit.ps1 new file mode 100644 index 0000000..ad9730b --- /dev/null +++ b/Lifecycle-Virtual/VmWare-LifeCycle-CreateAndDestroy/esxi-resource-limit.ps1 @@ -0,0 +1,12 @@ +param( +[string]$vcenter, +[string]$vmName, +[string]$un, +[string]$pw +) + +Get-Module -ListAvailable PowerCLI* | Import-Module -Verbose:$false +Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false +Connect-ViServer -Server $vcenter -User $un -Password $pw -Verbose:$false + +Get-VM -Name "$vmName" | Get-VMResourceConfiguration |Set-VMResourceConfiguration -CpuLimitMhz 3000 diff --git a/Lifecycle-Virtual/VmWare-LifeCycle-PowerMgmt/README.md b/Lifecycle-Virtual/VmWare-LifeCycle-PowerMgmt/README.md new file mode 100644 index 0000000..c7f0877 --- /dev/null +++ b/Lifecycle-Virtual/VmWare-LifeCycle-PowerMgmt/README.md @@ -0,0 +1 @@ +Power management for kvm/vmware guests at RackRental/TSYS \ No newline at end of file diff --git a/Lifecycle-Virtual/VmWare-LifeCycle-PowerMgmt/esxi-PowerCycle.ps1 b/Lifecycle-Virtual/VmWare-LifeCycle-PowerMgmt/esxi-PowerCycle.ps1 new file mode 100644 index 0000000..eb2e77f --- /dev/null +++ b/Lifecycle-Virtual/VmWare-LifeCycle-PowerMgmt/esxi-PowerCycle.ps1 @@ -0,0 +1,12 @@ +param( +[string]$vcenter, +[string]$vm, +[string]$un, +[string]$pw +) + +Get-Module -ListAvailable PowerCLI* | Import-Module -Verbose:$false > /dev/null +Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false > /dev/null +Connect-ViServer -Server $vcenter -User "$un" -Password "$pw" -Verbose:$false > /dev/null +Stop-VM -RunAsync -VM "$vm" -Confirm:$false -Verbose:$false > /dev/null +Start-VM -RunAsync -VM "$vm" -Confirm:$false -Verbose:$false > /dev/null \ No newline at end of file diff --git a/Lifecycle-Virtual/VmWare-LifeCycle-PowerMgmt/esxi-PowerOff.ps1 b/Lifecycle-Virtual/VmWare-LifeCycle-PowerMgmt/esxi-PowerOff.ps1 new file mode 100644 index 0000000..afef9e8 --- /dev/null +++ b/Lifecycle-Virtual/VmWare-LifeCycle-PowerMgmt/esxi-PowerOff.ps1 @@ -0,0 +1,11 @@ +param( +[string]$vcenter, +[string]$vm, +[string]$un, +[string]$pw +) + +Get-Module -ListAvailable PowerCLI* | Import-Module -Verbose:$false > /dev/null +Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false > /dev/null +Connect-ViServer -Server $vcenter -User "$un" -Password "$pw" -Verbose:$false > /dev/null +Stop-VM -RunAsync -VM "$vm" -Confirm:$false -Verbose:$false > /dev/null diff --git a/Lifecycle-Virtual/VmWare-LifeCycle-PowerMgmt/esxi-PowerOn.ps1 b/Lifecycle-Virtual/VmWare-LifeCycle-PowerMgmt/esxi-PowerOn.ps1 new file mode 100644 index 0000000..48e924c --- /dev/null +++ b/Lifecycle-Virtual/VmWare-LifeCycle-PowerMgmt/esxi-PowerOn.ps1 @@ -0,0 +1,11 @@ +param( +[string]$vcenter, +[string]$vm, +[string]$un, +[string]$pw +) + +Get-Module -ListAvailable PowerCLI* | Import-Module -Verbose:$false > /dev/null +Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false > /dev/null +Connect-ViServer -Server $vcenter -User "$un" -Password "$pw" -Verbose:$false > /dev/null +Start-VM -RunAsync -VM "$vm" -Confirm:$false -Verbose:$false > /dev/null \ No newline at end of file diff --git a/createLxc.sh b/Provision-Container/createLxc.sh similarity index 100% rename from createLxc.sh rename to Provision-Container/createLxc.sh