Vmware CLI Value Commands

      Yorum yok Vmware CLI Value Commands

VM Power CLI

Connect-VIServer -Server 10.200.115.15

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
Set-PowerCLIConfiguration -Scope User -InvalidCertificateAction warn

ESXI host Register VM

find /vmfs/volumes/5e663972-baa48407-c77d-ac162d8cfb90 -name "*.vmx" -exec vim-cmd solo/registervm {} \;

ESXi
Register all VMs on a single datastore.

~ # find /vmfs/volumes/<datastorename>/ -maxdepth 2 -name '*.vmx' -exec vim-cmd solo/registervm "{}" \;
Register all VMs on all datastores.

~ # find /vmfs/volumes/ -maxdepth 3 -name '*.vmx' -exec vim-cmd solo/registervm "{}" \;
ESX
Register all VMs on a single datastore.

~ # find /vmfs/volumes/<datastorename>/ -maxdepth 2 -name '*.vmx' -exec vmware-cmd -s register "{}" \;
Register all VMs on all datastores.

~ # find /vmfs/volumes/ -maxdepth 3 -name '*.vmx' -exec vmware-cmd -s register "{}" \;
~ # find /vmfs/volumes/5e663972-baa48407-c77d-ac162d8cfb90 -name "*.vmx" -exec vim-cmd solo/registervm {} \;

 

RDM Disks

Use RDM disk in physical compatibility
Use RDM disk with lower size than 2TB in using virtual compatibility

 

VM Commands

Install-Module -Name VMware.PowerCLI
-----------------------------------------------

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
Connect-VIServer -Server 10.200.115.100

Get-VM -name *REPLICA
Get-VM -name *REPLICA | Get-NetworkAdapter
Get-VM -name *REPLICA | Start-VM
Get-VM -name *REPLICA | Get-VMQuestion | Set-VMQuestion -DefaultOption
Get-VM -name *REPLICA | Get-NetworkAdapter | Set-NetworkAdapter -Connected:$true
Get-VM -name *REPLICA | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName ODM_VLAN_122
Get-VM -name *REPLICA | Get-NetworkAdapter | Set-NetworkAdapter -Connected:$true

Get-VM -name *REPLICA | Set-VMQuestion –Option "I Copied it"
Get-VM -name *REPLICA | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName ODM_VLAN_122 -Confirm:$false
Get-VMQuestion | Set-VMQuestion –Option "I copied it"

Get-VM -name *REPLICA | Stop-VM
Get-VM -name *REPLICA | Remove-Inventory

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

This site uses Akismet to reduce spam. Learn how your comment data is processed.