SlideShare a Scribd company logo
1 of 16
VMware PowerCLI
Introduction, Performace Tweaks and Specials
Speaker Introduction
Web: mycloudrevolution.com
Twitter: @vMarkus_K
Work: QSC AG (Hamburg)
Table of Content
• Introduction to VMware PowerCLI
• Demo
• Performance Tweaks
• PowerCLI Special
• VM IDs
• Q&A
Introduction
PowerShell vs. PowerShell Core
Introduction
Modules
• The Core-Module is for VMware vSphere
Introduction
Community
PowerNSX (Core)
PowerVRA / PowerVRO
PowerVRNI
Introduction
Community
https://powercli.ideas.aha.io/
Demo
Basics
# Init
## Import VMware Modules
Get-Module -Name VMware* -ListAvailable | Import-Module
## Connect vCenter
Connect-VIServer vcenter-01.lab.local
## Prepare VMs
$sourceVMName = "test"
For ($i=1; $i -le 20; $i++) {
$newVMName = [String]($sourceVMName + $i)
New-VM -Name $newVMName -VM $sourceVMName -VMHost "esxi-01.lab.local" -Datastore "vol_vmware_01" -DiskStorageFormat Thin
}
• Load Module
• Connect vCenter or ESXi Host
• [Clone Lab VMs]
Demo
Performance Tweaks
• Methods!
• Get-VM vs. Get-View
# Perf - Methoden / Get-View mit Filter
## Init Array of VMs
$VMs = Get-VM
## Where-Object Cmdlet
Measure-Command { $VMs | Where-Object {$_.Name -eq "test"} }
## Where Methode
Measure-Command { $VMs.Where({$_.Name -eq "test"}) }
## Where Split
$VMsOn, $VMsOff = $VMs.Where({$_.PowerState -eq "PoweredOn"}, "Split")
$VMsOn.Count
$VMsOff.Count
## Get-View mit Filter gegen Get-VM mit Where-Object
Measure-Command {Get-VM -Name "test" | fl}
Measure-Command {Get-View -ViewType VirtualMachine -Filter @{Name="^test"} | fl}
Demo
Performance Tweaks – Results in larger scale
• Test with 227 Hosts / 2551 VMs
Demo
PowerCLI Special - PSDrive to VMware Datastore
• Mount VMware Datastore as a PSDrive
[String]$LocalPath = "C:tempdummy.txt"
[String]$TempDatastoreName = "*local"
[Array]$VMhosts = Get-VMHost
$VMhosts.ForEach({
$Datastore = $_| Get-Datastore -Name $TempDatastoreName
$DatastoreDriveName = "HostStore_" + $_.Name.Split(".")[0]
$Datastore | New-DatastoreDrive -Name $DatastoreDriveName | Out-Null
Copy-DatastoreItem -Item $LocalPath -Destination $($DatastoreDriveName + ":") -Force:$true -Confirm:$false
Remove-PSDrive -Name $DatastoreDriveName
})
Demo
PowerCLI Special – ESXCLI -V2
• Example: Patch installation
• Native PowerCLI Cmdlet does only upgrade packages
• ESXCLI can do up- and downgrade of packages
# ESXCLI -V2
$VMHost = $VMHosts | select -First 1
$Datastore = $VMHost | Get-Datastore -Name $TempDatastoreName
$HostPath = $Datastore.ExtensionData.Info.Url.remove(0,5) + $LocalPath.Split("")[-1]
## Install-VMhost
Install-VMHostPatch -VMHost $VMHost -HostPath $HostPath
## ESXCLI V2
$esxcli2 = Get-ESXCLI -VMHost $VMhost -V2
### List
$esxcli2.software.vib.list.Invoke() | FT -AutoSize
### Install
$CreateArgs = $esxcli2.software.vib.install.CreateArgs()
$CreateArgs.depot = $HostPath
$InstallResponse = $esxcli2.software.vib.install.Invoke($CreateArgs)
Demo
PowerCLI Special – Invoke-VMScript
• Enhanced: Invoke-VMScriptPlus V2
(http://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/)
• Multi-Line Scripts
• More Script-Types
$Pass = ConvertTo-SecureString 'Passw0rd!' -AsPlainText -Force
$sInvP = @{
VM = 'PhotonOS'
ScriptType = 'Bash'
ScriptText = $code
GuestOSType = 'Linux'
GuestUser = 'root'
GuestPassword = $Pass
}
Invoke-VMScriptPlus @sInvP
Demo
VM IDs – Basics
• UUID
uuid.bios / Generated by ESXi Host / Known by Guest OS as BIOS UUID
• InstanceUUID
vc.uuid / Generated by vCenter
• LocationsID
uuid.location / Hash of VMX File and ESXi UUID / vCenter needs this to idenfy third party changes to
the VM
• MoRef
Managed Object Reference / Generated by vCenter / Used by MOB, APIs and vCenter
Get-VM -Name "Veeam-03" | Get-VMID
Demo
VM IDs – Identify Guest OS
$sInvP = @{
VM = 'Veeam-03'
ScriptType = 'PowerShell'
GuestOSType = 'Windows'
ScriptText = $code
GuestCredential = $cred
}
Remove-Variable UUIDwin, UUIDreturn -ErrorAction SilentlyContinue
$UUIDreturn = Invoke-VMScriptPlus @sInvP
[String]$UUIDwin = $UUIDreturn.ScriptOutput
Convert-UUID -UUIDwin $UUIDwin
Get-VM -Name "Veeam-03" | Get-VMID | select UUID
• Match Guest OS to vSphere VM
Q&A

More Related Content

What's hot

Rapid Infrastructure Provisioning
Rapid Infrastructure ProvisioningRapid Infrastructure Provisioning
Rapid Infrastructure ProvisioningUchit Vyas ☁
 
PowerCLI for the PowerShell Inclined
PowerCLI for the PowerShell InclinedPowerCLI for the PowerShell Inclined
PowerCLI for the PowerShell InclinedJosh Atwell
 
Ansible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David KarbanAnsible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David Karbanansiblebrno
 
A Introduction of Packer
A Introduction of PackerA Introduction of Packer
A Introduction of PackerFreyr Lin
 
Automation with Packer and TerraForm
Automation with Packer and TerraFormAutomation with Packer and TerraForm
Automation with Packer and TerraFormWesley Charles Blake
 
VSTS/ TFS automated Release Pipelines for Web Applications with Docker
VSTS/ TFS automated Release Pipelines for Web Applications with DockerVSTS/ TFS automated Release Pipelines for Web Applications with Docker
VSTS/ TFS automated Release Pipelines for Web Applications with DockerMarc Müller
 
Configuration management and deployment with ansible
Configuration management and deployment with ansibleConfiguration management and deployment with ansible
Configuration management and deployment with ansibleIvan Dimitrov
 
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013Puppet
 
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackke4qqq
 
Puppet and CloudStack
Puppet and CloudStackPuppet and CloudStack
Puppet and CloudStackke4qqq
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStackPuppet
 
개발자를 위한 Amazon Lightsail Deep-Dive
개발자를 위한 Amazon Lightsail Deep-Dive개발자를 위한 Amazon Lightsail Deep-Dive
개발자를 위한 Amazon Lightsail Deep-Dive창훈 정
 
Terraform: Cloud Configuration Management (WTC/IPC'16)
Terraform: Cloud Configuration Management (WTC/IPC'16)Terraform: Cloud Configuration Management (WTC/IPC'16)
Terraform: Cloud Configuration Management (WTC/IPC'16)Martin Schütte
 
Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2Jeff Geerling
 
Getting Started with WP-CLI, a tool to automate your life
Getting Started with WP-CLI, a tool to automate your lifeGetting Started with WP-CLI, a tool to automate your life
Getting Started with WP-CLI, a tool to automate your lifeAJ Morris
 

What's hot (20)

Rapid Infrastructure Provisioning
Rapid Infrastructure ProvisioningRapid Infrastructure Provisioning
Rapid Infrastructure Provisioning
 
ansible why ?
ansible why ?ansible why ?
ansible why ?
 
PowerCLI for the PowerShell Inclined
PowerCLI for the PowerShell InclinedPowerCLI for the PowerShell Inclined
PowerCLI for the PowerShell Inclined
 
Ansible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David KarbanAnsible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David Karban
 
A Introduction of Packer
A Introduction of PackerA Introduction of Packer
A Introduction of Packer
 
Automation with Packer and TerraForm
Automation with Packer and TerraFormAutomation with Packer and TerraForm
Automation with Packer and TerraForm
 
VSTS/ TFS automated Release Pipelines for Web Applications with Docker
VSTS/ TFS automated Release Pipelines for Web Applications with DockerVSTS/ TFS automated Release Pipelines for Web Applications with Docker
VSTS/ TFS automated Release Pipelines for Web Applications with Docker
 
Configuration management and deployment with ansible
Configuration management and deployment with ansibleConfiguration management and deployment with ansible
Configuration management and deployment with ansible
 
Packer
Packer Packer
Packer
 
Bosh 2.0
Bosh 2.0Bosh 2.0
Bosh 2.0
 
wp cli
wp cliwp cli
wp cli
 
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
 
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStack
 
Puppet and CloudStack
Puppet and CloudStackPuppet and CloudStack
Puppet and CloudStack
 
Ansible
AnsibleAnsible
Ansible
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStack
 
개발자를 위한 Amazon Lightsail Deep-Dive
개발자를 위한 Amazon Lightsail Deep-Dive개발자를 위한 Amazon Lightsail Deep-Dive
개발자를 위한 Amazon Lightsail Deep-Dive
 
Terraform: Cloud Configuration Management (WTC/IPC'16)
Terraform: Cloud Configuration Management (WTC/IPC'16)Terraform: Cloud Configuration Management (WTC/IPC'16)
Terraform: Cloud Configuration Management (WTC/IPC'16)
 
Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2
 
Getting Started with WP-CLI, a tool to automate your life
Getting Started with WP-CLI, a tool to automate your lifeGetting Started with WP-CLI, a tool to automate your life
Getting Started with WP-CLI, a tool to automate your life
 

Similar to VMware PowerCLI: Performance Tweaks and Special Features

Automating OSD and Post-OSD Configuration with Powershell and Orchestrator
Automating OSD and Post-OSD Configuration with Powershell and OrchestratorAutomating OSD and Post-OSD Configuration with Powershell and Orchestrator
Automating OSD and Post-OSD Configuration with Powershell and OrchestratorDigicomp Academy AG
 
Automating Azure VMs with PowerShell
Automating Azure VMs with PowerShellAutomating Azure VMs with PowerShell
Automating Azure VMs with PowerShellAlexander Feschenko
 
Provisioning in Microsoft Azure
Provisioning in Microsoft AzureProvisioning in Microsoft Azure
Provisioning in Microsoft Azureilagin
 
Itb session v_memcached
Itb session v_memcachedItb session v_memcached
Itb session v_memcachedSkills Matter
 
Poster vmware-management-with-vcli-5.0
Poster vmware-management-with-vcli-5.0Poster vmware-management-with-vcli-5.0
Poster vmware-management-with-vcli-5.0Fredy Ricse
 
Automating Windows Azure
Automating Windows AzureAutomating Windows Azure
Automating Windows AzureIdo Flatow
 
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGHDeploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGHErica Windisch
 
Building cloud stack at scale
Building cloud stack at scaleBuilding cloud stack at scale
Building cloud stack at scaleShapeBlue
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShellDale Lane
 
Google App Engine Developer - Day4
Google App Engine Developer - Day4Google App Engine Developer - Day4
Google App Engine Developer - Day4Simon Su
 
Power Cli Workshop London Vmug
Power Cli Workshop London VmugPower Cli Workshop London Vmug
Power Cli Workshop London Vmugjonathanmedd
 
Fullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-endFullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-endEzequiel Maraschio
 
SharePoint Administration with PowerShell
SharePoint Administration with PowerShellSharePoint Administration with PowerShell
SharePoint Administration with PowerShellEric Kraus
 
How to create your own hack environment
How to create your own hack environmentHow to create your own hack environment
How to create your own hack environmentSumedt Jitpukdebodin
 
Paul Angus (ShapeBlue) - Push infrastructure with Ansible #DOXLON
Paul Angus (ShapeBlue) - Push infrastructure with Ansible #DOXLONPaul Angus (ShapeBlue) - Push infrastructure with Ansible #DOXLON
Paul Angus (ShapeBlue) - Push infrastructure with Ansible #DOXLONOutlyer
 
Enrique lima azure-it-pro-ps
Enrique lima azure-it-pro-psEnrique lima azure-it-pro-ps
Enrique lima azure-it-pro-psEnrique Lima
 
Mmik_Powershell_DSC_Azure_DSC
Mmik_Powershell_DSC_Azure_DSCMmik_Powershell_DSC_Azure_DSC
Mmik_Powershell_DSC_Azure_DSCMmik Huang
 
Mmik powershell dsc_slideshare_v1
Mmik powershell dsc_slideshare_v1Mmik powershell dsc_slideshare_v1
Mmik powershell dsc_slideshare_v1Mmik Huang
 

Similar to VMware PowerCLI: Performance Tweaks and Special Features (20)

Automating OSD and Post-OSD Configuration with Powershell and Orchestrator
Automating OSD and Post-OSD Configuration with Powershell and OrchestratorAutomating OSD and Post-OSD Configuration with Powershell and Orchestrator
Automating OSD and Post-OSD Configuration with Powershell and Orchestrator
 
Automating Azure VMs with PowerShell
Automating Azure VMs with PowerShellAutomating Azure VMs with PowerShell
Automating Azure VMs with PowerShell
 
Provisioning in Microsoft Azure
Provisioning in Microsoft AzureProvisioning in Microsoft Azure
Provisioning in Microsoft Azure
 
Deploying SharePoint @ Cloud
Deploying SharePoint @ CloudDeploying SharePoint @ Cloud
Deploying SharePoint @ Cloud
 
Itb session v_memcached
Itb session v_memcachedItb session v_memcached
Itb session v_memcached
 
Poster vmware-management-with-vcli-5.0
Poster vmware-management-with-vcli-5.0Poster vmware-management-with-vcli-5.0
Poster vmware-management-with-vcli-5.0
 
Automating Windows Azure
Automating Windows AzureAutomating Windows Azure
Automating Windows Azure
 
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGHDeploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
 
Building cloud stack at scale
Building cloud stack at scaleBuilding cloud stack at scale
Building cloud stack at scale
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShell
 
Google App Engine Developer - Day4
Google App Engine Developer - Day4Google App Engine Developer - Day4
Google App Engine Developer - Day4
 
VMworld 2011 - PowerCLI 101
VMworld 2011 - PowerCLI 101VMworld 2011 - PowerCLI 101
VMworld 2011 - PowerCLI 101
 
Power Cli Workshop London Vmug
Power Cli Workshop London VmugPower Cli Workshop London Vmug
Power Cli Workshop London Vmug
 
Fullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-endFullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-end
 
SharePoint Administration with PowerShell
SharePoint Administration with PowerShellSharePoint Administration with PowerShell
SharePoint Administration with PowerShell
 
How to create your own hack environment
How to create your own hack environmentHow to create your own hack environment
How to create your own hack environment
 
Paul Angus (ShapeBlue) - Push infrastructure with Ansible #DOXLON
Paul Angus (ShapeBlue) - Push infrastructure with Ansible #DOXLONPaul Angus (ShapeBlue) - Push infrastructure with Ansible #DOXLON
Paul Angus (ShapeBlue) - Push infrastructure with Ansible #DOXLON
 
Enrique lima azure-it-pro-ps
Enrique lima azure-it-pro-psEnrique lima azure-it-pro-ps
Enrique lima azure-it-pro-ps
 
Mmik_Powershell_DSC_Azure_DSC
Mmik_Powershell_DSC_Azure_DSCMmik_Powershell_DSC_Azure_DSC
Mmik_Powershell_DSC_Azure_DSC
 
Mmik powershell dsc_slideshare_v1
Mmik powershell dsc_slideshare_v1Mmik powershell dsc_slideshare_v1
Mmik powershell dsc_slideshare_v1
 

Recently uploaded

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

VMware PowerCLI: Performance Tweaks and Special Features

  • 3. Table of Content • Introduction to VMware PowerCLI • Demo • Performance Tweaks • PowerCLI Special • VM IDs • Q&A
  • 8. Demo Basics # Init ## Import VMware Modules Get-Module -Name VMware* -ListAvailable | Import-Module ## Connect vCenter Connect-VIServer vcenter-01.lab.local ## Prepare VMs $sourceVMName = "test" For ($i=1; $i -le 20; $i++) { $newVMName = [String]($sourceVMName + $i) New-VM -Name $newVMName -VM $sourceVMName -VMHost "esxi-01.lab.local" -Datastore "vol_vmware_01" -DiskStorageFormat Thin } • Load Module • Connect vCenter or ESXi Host • [Clone Lab VMs]
  • 9. Demo Performance Tweaks • Methods! • Get-VM vs. Get-View # Perf - Methoden / Get-View mit Filter ## Init Array of VMs $VMs = Get-VM ## Where-Object Cmdlet Measure-Command { $VMs | Where-Object {$_.Name -eq "test"} } ## Where Methode Measure-Command { $VMs.Where({$_.Name -eq "test"}) } ## Where Split $VMsOn, $VMsOff = $VMs.Where({$_.PowerState -eq "PoweredOn"}, "Split") $VMsOn.Count $VMsOff.Count ## Get-View mit Filter gegen Get-VM mit Where-Object Measure-Command {Get-VM -Name "test" | fl} Measure-Command {Get-View -ViewType VirtualMachine -Filter @{Name="^test"} | fl}
  • 10. Demo Performance Tweaks – Results in larger scale • Test with 227 Hosts / 2551 VMs
  • 11. Demo PowerCLI Special - PSDrive to VMware Datastore • Mount VMware Datastore as a PSDrive [String]$LocalPath = "C:tempdummy.txt" [String]$TempDatastoreName = "*local" [Array]$VMhosts = Get-VMHost $VMhosts.ForEach({ $Datastore = $_| Get-Datastore -Name $TempDatastoreName $DatastoreDriveName = "HostStore_" + $_.Name.Split(".")[0] $Datastore | New-DatastoreDrive -Name $DatastoreDriveName | Out-Null Copy-DatastoreItem -Item $LocalPath -Destination $($DatastoreDriveName + ":") -Force:$true -Confirm:$false Remove-PSDrive -Name $DatastoreDriveName })
  • 12. Demo PowerCLI Special – ESXCLI -V2 • Example: Patch installation • Native PowerCLI Cmdlet does only upgrade packages • ESXCLI can do up- and downgrade of packages # ESXCLI -V2 $VMHost = $VMHosts | select -First 1 $Datastore = $VMHost | Get-Datastore -Name $TempDatastoreName $HostPath = $Datastore.ExtensionData.Info.Url.remove(0,5) + $LocalPath.Split("")[-1] ## Install-VMhost Install-VMHostPatch -VMHost $VMHost -HostPath $HostPath ## ESXCLI V2 $esxcli2 = Get-ESXCLI -VMHost $VMhost -V2 ### List $esxcli2.software.vib.list.Invoke() | FT -AutoSize ### Install $CreateArgs = $esxcli2.software.vib.install.CreateArgs() $CreateArgs.depot = $HostPath $InstallResponse = $esxcli2.software.vib.install.Invoke($CreateArgs)
  • 13. Demo PowerCLI Special – Invoke-VMScript • Enhanced: Invoke-VMScriptPlus V2 (http://www.lucd.info/2018/08/05/invoke-vmscriptplus-v2/) • Multi-Line Scripts • More Script-Types $Pass = ConvertTo-SecureString 'Passw0rd!' -AsPlainText -Force $sInvP = @{ VM = 'PhotonOS' ScriptType = 'Bash' ScriptText = $code GuestOSType = 'Linux' GuestUser = 'root' GuestPassword = $Pass } Invoke-VMScriptPlus @sInvP
  • 14. Demo VM IDs – Basics • UUID uuid.bios / Generated by ESXi Host / Known by Guest OS as BIOS UUID • InstanceUUID vc.uuid / Generated by vCenter • LocationsID uuid.location / Hash of VMX File and ESXi UUID / vCenter needs this to idenfy third party changes to the VM • MoRef Managed Object Reference / Generated by vCenter / Used by MOB, APIs and vCenter Get-VM -Name "Veeam-03" | Get-VMID
  • 15. Demo VM IDs – Identify Guest OS $sInvP = @{ VM = 'Veeam-03' ScriptType = 'PowerShell' GuestOSType = 'Windows' ScriptText = $code GuestCredential = $cred } Remove-Variable UUIDwin, UUIDreturn -ErrorAction SilentlyContinue $UUIDreturn = Invoke-VMScriptPlus @sInvP [String]$UUIDwin = $UUIDreturn.ScriptOutput Convert-UUID -UUIDwin $UUIDwin Get-VM -Name "Veeam-03" | Get-VMID | select UUID • Match Guest OS to vSphere VM
  • 16. Q&A