#Set ENV
$VM = Get-Content .\vmhost_list.txt
$BackupvCenter = "vCenter.domain.local"
$BackupHost = "esxi-01.Domain.local"
$backupDate = Get-Date -Format yyyyMMdd
$backupDatastore = "vmd-01:LocalStorage"
Connect-VIServer -Server $BackupvCenter -User user_name@domain.local -Password user_password
#Dynamically create a folder
$BackupDir = "E:\vMware-backup\$BackupDate"
mkdir $BackupDir
foreach ($line in $VM) {
Get-VM -Server $BackupvCenter | where { $_.PowerState -like 'PoweredOn' -and $_.name -like $line } | select name, vmhost, usedspacegb
$VM_TMP = $line+'-ova_backup-'+$backupDate
#Clone New VM
New-VM -Name $VM_TMP -VM $line -VMHost $BackupHost -Datastore $backupDatastore
#Export OVA file
Export-VApp -Destination $BackupDir -VM $VM_TMP -Format OVA
#Remove-VM $TMP -DeleteFromDisk -Confirm:$true
}
Subscribe to:
Post Comments (Atom)
ALCATEL 6900
write memory copy running certified reload from working no rollback-timeout
-
grant execute on utl_http to wc grant execute on dbms_lock to wc; BEGIN DBMS_NETWORK_ACL_ADMIN.create_acl ( acl => &...
-
:system view system-view or sys :show all config dis current-configuration :create vlan vlan vlan_number :show ip interface ...
-
``` sda: add missing path sda: failed to get udev uid: Invalid argument sda: failed to get sysfs uid: Invalid argument sda: failed to ge...
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.