<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Script to update hosts when using Auto Deploy(Stateless ESXi) in VMware PowerCLI Documents</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Script-to-update-hosts-when-using-Auto-Deploy-Stateless-ESXi/ta-p/2782711</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The attached script demonstrates how to automate host updates when using the Auto Deploy feature in vSphere 5.&amp;nbsp; Here's an excerpt from the comment at the top (take a look at the script for more details.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# This script will help automate patching/updating large numbers of&lt;/P&gt;&lt;DIV id="_mcePaste"&gt;# stateless hosts.&amp;nbsp; On the first invocation of the script, specify&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;# a cluster to remediate, the new image profile, and the old image mapping&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;# rule.&amp;nbsp; The script will update the deploy rule to use the new image profile.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;# The script will then loop through all the hosts in the cluster,&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;# put them in maintenance mode, and reboot once the VMs are migrated off&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;# via DRS.&amp;nbsp; On subsequent invocations of the script, you can specify&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;# just the cluster (this assumes you have multiple clusters that leverage&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;# the same image profile deploy rule in Auto Deploy)&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example of what using this script might look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Connect-VIServer MyVcHostName&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Add-EsxSoftwareDepot &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml"&gt;https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Get-EsxImageProfile&lt;/P&gt;&lt;P&gt;# Scan through the list and pick the one you want&lt;/P&gt;&lt;P&gt;Get-DeployRule&lt;/P&gt;&lt;P&gt;# Note the name of your image profile assignment rule&lt;/P&gt;&lt;P&gt;.\ad-update.ps1 MyClusterName ESXi-5.0.0-XXXXXX-no-tools MyDeployRule&lt;/P&gt;&lt;P&gt;# Replace XXXXXX with the build number, or alternative image profile name as the second argument&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also use your own custom image profiles by leveraging the image builder cmdlets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Awesome script Daniel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This document was generated from the following discussion: &lt;A&gt;javascript:;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Sep 2011 21:32:05 GMT</pubDate>
    <dc:creator>alanrenouf</dc:creator>
    <dc:date>2011-09-12T21:32:05Z</dc:date>
    <item>
      <title>Script to update hosts when using Auto Deploy(Stateless ESXi)</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Script-to-update-hosts-when-using-Auto-Deploy-Stateless-ESXi/ta-p/2782711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The attached script demonstrates how to automate host updates when using the Auto Deploy feature in vSphere 5.&amp;nbsp; Here's an excerpt from the comment at the top (take a look at the script for more details.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# This script will help automate patching/updating large numbers of&lt;/P&gt;&lt;DIV id="_mcePaste"&gt;# stateless hosts.&amp;nbsp; On the first invocation of the script, specify&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;# a cluster to remediate, the new image profile, and the old image mapping&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;# rule.&amp;nbsp; The script will update the deploy rule to use the new image profile.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;# The script will then loop through all the hosts in the cluster,&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;# put them in maintenance mode, and reboot once the VMs are migrated off&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;# via DRS.&amp;nbsp; On subsequent invocations of the script, you can specify&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;# just the cluster (this assumes you have multiple clusters that leverage&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;# the same image profile deploy rule in Auto Deploy)&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example of what using this script might look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Connect-VIServer MyVcHostName&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Add-EsxSoftwareDepot &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml"&gt;https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Get-EsxImageProfile&lt;/P&gt;&lt;P&gt;# Scan through the list and pick the one you want&lt;/P&gt;&lt;P&gt;Get-DeployRule&lt;/P&gt;&lt;P&gt;# Note the name of your image profile assignment rule&lt;/P&gt;&lt;P&gt;.\ad-update.ps1 MyClusterName ESXi-5.0.0-XXXXXX-no-tools MyDeployRule&lt;/P&gt;&lt;P&gt;# Replace XXXXXX with the build number, or alternative image profile name as the second argument&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also use your own custom image profiles by leveraging the image builder cmdlets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Awesome script Daniel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This document was generated from the following discussion: &lt;A&gt;javascript:;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2011 21:32:05 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Script-to-update-hosts-when-using-Auto-Deploy-Stateless-ESXi/ta-p/2782711</guid>
      <dc:creator>alanrenouf</dc:creator>
      <dc:date>2011-09-12T21:32:05Z</dc:date>
    </item>
  </channel>
</rss>

