<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/clearspace/rss" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>VMware Communities: Message List - Hot to set vm's CpuFeatureMask ?</title>
    <link>http://communities.vmware.com/community/vmtn/vsphere/automationtools/windows_toolkit?view=discussions</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    <pubDate>Wed, 04 Jun 2008 15:26:49 GMT</pubDate>
    <generator>Clearspace 1.10.12 (http://jivesoftware.com/products/clearspace/)</generator>
    <dc:date>2008-06-04T15:26:49Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Re: Hot to set vm's CpuFeatureMask ?</title>
      <link>http://communities.vmware.com/message/962783?tstart=0#962783</link>
      <description>Nice. I'll forward this thread to the people responsible for that KB.</description>
      <pubDate>Wed, 04 Jun 2008 15:26:49 GMT</pubDate>
      <author>c_shanklin</author>
      <guid>http://communities.vmware.com/message/962783?tstart=0#962783</guid>
      <dc:date>2008-06-04T15:26:49Z</dc:date>
      <clearspace:dateToText>1 year, 5 months ago</clearspace:dateToText>
    </item>
    <item>
      <title>Re: Hot to set vm's CpuFeatureMask ?</title>
      <link>http://communities.vmware.com/message/962775?tstart=0#962775</link>
      <description>&lt;br /&gt;
OK, I have a workaround using a modified version of the script above since I couldn't find sufficient instructions on masking it in VirtualCenter.  (If anyone knows how, I would love to know.  KB 1993 is lacking in detail.)&lt;br /&gt;
&lt;p /&gt;
Here is a modified version of the script above (thanks again) that updates all of your VMs on a server/farm that mimicks the processor masking that VC does when I cold-migrate a server (minus the AMD masking since I didn't need it):&lt;br /&gt;
&lt;p /&gt;
Add-PSsnapin VMware.VimAutomation.Core&lt;br /&gt;
&lt;p /&gt;
&lt;ol&gt;
&lt;li&gt;Note:  use login credentials if needed&lt;/li&gt;
&lt;/ol&gt;
get-viserver &amp;lt;servername&amp;gt; &lt;br /&gt;
&lt;p /&gt;
&lt;ol&gt;
&lt;li&gt;Mask SSE 4.1 Extensions to the guest.&lt;/li&gt;
&lt;/ol&gt;
function Mask-Extensions($vm) {&lt;br /&gt;
 $view = get-view $vm.id&lt;br /&gt;
        write-host "Setting Mask for:  "$vm.Name&lt;br /&gt;
 $vmConfigSpec = new-object VMware.Vim.VirtualMachineConfigSpec&lt;br /&gt;
 $featureMask = new-object VMware.Vim.VirtualMachineCpuIdInfoSpec&lt;br /&gt;
 $featureMask.info = new-object VMware.Vim.HostCpuIdInfo&lt;br /&gt;
 $featureMask.info.eax = "xxxx------------xx--------------"&lt;br /&gt;
 $featureMask.info.level = 1&lt;br /&gt;
&lt;p /&gt;
 $featureMask.info.ecx = "--------R--R0-------------------"&lt;br /&gt;
 $featureMask.info.level = 1&lt;br /&gt;
&lt;p /&gt;
 $featureMask.info.edx = "---------------------------T----"&lt;br /&gt;
 $featureMask.info.level = 1      &lt;br /&gt;
&lt;p /&gt;
 $vmConfigSpec.CpuFeatureMask = $featureMask&lt;br /&gt;
&lt;p /&gt;
 $view.ReconfigVM($vmConfigSpec)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
get-vm | ForEach {Mask-Extensions ($_)}&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
I'm sure there is a better way, but at least I can sleep now knowing that my VMs can HA/DRS. &lt;img class="jive-emoticon" border="0" src="http://communities.vmware.com/images/emoticons/wink.gif" alt=";-)" /&gt;</description>
      <pubDate>Wed, 04 Jun 2008 15:06:50 GMT</pubDate>
      <author>culbeda</author>
      <guid>http://communities.vmware.com/message/962775?tstart=0#962775</guid>
      <dc:date>2008-06-04T15:06:50Z</dc:date>
      <clearspace:dateToText>1 year, 5 months ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>Re: Hot to set vm's CpuFeatureMask ?</title>
      <link>http://communities.vmware.com/message/962025?tstart=0#962025</link>
      <description>&lt;br /&gt;
I was curious about the AMD mask as well, but it keeps putting them in.  And I performed the change while the VM was powered off.  Still no love.</description>
      <pubDate>Tue, 03 Jun 2008 21:23:02 GMT</pubDate>
      <author>culbeda</author>
      <guid>http://communities.vmware.com/message/962025?tstart=0#962025</guid>
      <dc:date>2008-06-03T21:23:02Z</dc:date>
      <clearspace:dateToText>1 year, 5 months ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
    </item>
    <item>
      <title>Re: Hot to set vm's CpuFeatureMask ?</title>
      <link>http://communities.vmware.com/message/961985?tstart=0#961985</link>
      <description>&lt;br /&gt;
I'm not much of an expert on this one, unfortunately. What I find really strange is the AMD extensions it added when you did the cold migration.&lt;br /&gt;
&lt;p /&gt;
Did you restart the VMs before after you applied the CPU feature mask?</description>
      <pubDate>Tue, 03 Jun 2008 20:59:21 GMT</pubDate>
      <author>c_shanklin</author>
      <guid>http://communities.vmware.com/message/961985?tstart=0#961985</guid>
      <dc:date>2008-06-03T20:59:21Z</dc:date>
      <clearspace:dateToText>1 year, 5 months ago</clearspace:dateToText>
      <clearspace:replyCount>3</clearspace:replyCount>
    </item>
    <item>
      <title>Re: Hot to set vm's CpuFeatureMask ?</title>
      <link>http://communities.vmware.com/message/961871?tstart=0#961871</link>
      <description>&lt;br /&gt;
Thanks for the script.  I've tried it and verified that the change registered in VC, but I'm still getting errors migrating from my Clovertown (X53xx) cores to my Harpertown cores (E54xx).&lt;br /&gt;
&lt;p /&gt;
The error says:&lt;br /&gt;
&lt;p /&gt;
 Unable to migrate from &amp;lt;server1&amp;gt; to &amp;lt;server2&amp;gt;:  Host CPU is incompatible with the virtual machine's requirements at CPUID level 0x1 register 'ecx'.&lt;br /&gt;
&lt;p /&gt;
host bits: 0000:0000:0000:1100:1110:0011:1011:1101&lt;br /&gt;
&lt;p /&gt;
required:  0000:0000:0000:010x:xxx0:0x1x:xxx1:x101&lt;br /&gt;
&lt;p /&gt;
Mismatch detected for these features:&lt;br /&gt;
&lt;p /&gt;
&lt;ul&gt;
&lt;li&gt;SSE4.1; refer to KB article 1993 for a possible solution&lt;/li&gt;
&lt;/ul&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
Based on that output, I would THINK it woudl work since the one must be masked has been. &lt;br /&gt;
&lt;p /&gt;
I've reviewed KB 1993 and found it lacking.  If I let VC migrate the machine cold, it puts in the following mask:&lt;br /&gt;
&lt;p /&gt;
cpuid.1.eax = "xxxx------------xx--------------"&lt;br /&gt;
cpuid.1.ecx = "--------R--RR-------------------"&lt;br /&gt;
cpuid.1.edx = "---------------------------T----"&lt;br /&gt;
cpuid.80000001.eax.amd = "xxxx------------xx--------------"&lt;br /&gt;
cpuid.80000001.ecx.amd = "----------------------------0---"&lt;br /&gt;
cpuid.80000001.edx = "--------------------H-----------"&lt;br /&gt;
cpuid.80000001.edx.amd = "-----R--------------H------T----"&lt;br /&gt;
&lt;p /&gt;
 (Certainly more involved than the cpuid.1.ecx="---- ---- ---- 0--- ---- ---- ----" I was putting in.)&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
Anyway have any good ways to automate this?  Turning all of my new VMs off and migrating them to another host is a bit of a drag.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
Thanks!</description>
      <pubDate>Tue, 03 Jun 2008 20:09:54 GMT</pubDate>
      <author>culbeda</author>
      <guid>http://communities.vmware.com/message/961871?tstart=0#961871</guid>
      <dc:date>2008-06-03T20:09:54Z</dc:date>
      <clearspace:dateToText>1 year, 5 months ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
    </item>
    <item>
      <title>Re: Hot to set vm's CpuFeatureMask ?</title>
      <link>http://communities.vmware.com/message/961105?tstart=0#961105</link>
      <description>Excellent, excellent, I love this forum.&lt;br /&gt;
&lt;br /&gt;
Thanks a lot (as asoon as I test it, I'll give you a feedback): tested, works perfectly, thanks again. &lt;br /&gt;
&lt;p /&gt;
 VI Toolkit is definitely the greatest thing since sliced bread, saves me (us) tons of time.</description>
      <pubDate>Tue, 03 Jun 2008 06:55:12 GMT</pubDate>
      <author>jessey</author>
      <guid>http://communities.vmware.com/message/961105?tstart=0#961105</guid>
      <dc:date>2008-06-03T06:55:12Z</dc:date>
      <clearspace:dateToText>1 year, 5 months ago</clearspace:dateToText>
    </item>
    <item>
      <title>Re: Hot to set vm's CpuFeatureMask ?</title>
      <link>http://communities.vmware.com/message/960626?tstart=0#960626</link>
      <description>There's another object under VirtualMachineCpuIdInfoSpec where the real configuration happens.&lt;br /&gt;
&lt;br /&gt;
Here's an example that will disable SSE4.1 extensions as shown in the &lt;a class="jive-link-external" href="http://www.vmware.com/files/pdf/vmotion_info_guide.pdf"&gt;VMware VMotion Info Guide&lt;/a&gt; (Appendix C)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="jive-pre"&gt;&lt;code class="jive-code jive-plain"&gt;
# Mask SSE 4.1 Extensions to the guest.
function Mask-Extensions($vm) {
	$view = get-view $vm.id

	$vmConfigSpec = new-object VMware.Vim.VirtualMachineConfigSpec
	$featureMask = new-object VMware.Vim.VirtualMachineCpuIdInfoSpec
	$featureMask.info = new-object VMware.Vim.HostCpuIdInfo

	$featureMask.info.ecx = &amp;quot;---- ---- ---- 0--- ---- ---- ---- ----&amp;quot;
	$featureMask.info.level = 1

	$vmConfigSpec.CpuFeatureMask = $featureMask

	$view.ReconfigVM($vmConfigSpec)
}

Mask-Extensions (get-vm &amp;quot;My VM&amp;quot;)

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The code is also attached.</description>
      <pubDate>Mon, 02 Jun 2008 19:22:58 GMT</pubDate>
      <author>c_shanklin</author>
      <guid>http://communities.vmware.com/message/960626?tstart=0#960626</guid>
      <dc:date>2008-06-02T19:22:58Z</dc:date>
      <clearspace:dateToText>1 year, 5 months ago</clearspace:dateToText>
      <clearspace:replyCount>6</clearspace:replyCount>
    </item>
    <item>
      <title>Hot to set vm's CpuFeatureMask ?</title>
      <link>http://communities.vmware.com/message/960123?tstart=0#960123</link>
      <description>I guess I've to use something like:&lt;br /&gt;
&lt;br /&gt;
$vmConfigSpec = &lt;b&gt;New-Object&lt;/b&gt; VMware.Vim.VirtualMachineConfigSpec&lt;br /&gt;
&lt;p /&gt;
$vmConfigSpec.CpuFeatureMask = &lt;b&gt;New-Object&lt;/b&gt; VMware.Vim.VirtualMachineCpuIdInfoSpec&lt;br /&gt;
&lt;p /&gt;
and then use the ReconfigVM_Task&lt;br /&gt;
&lt;p /&gt;
But I get confused with the type VirtualMachineCpuIdInfoSpec, when I read CpuFeatureMask of an existing VM, it is an array of 10 elements, while the New-Object has only one element and not the same properties..?&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
Thanks for help.</description>
      <pubDate>Mon, 02 Jun 2008 14:14:41 GMT</pubDate>
      <author>jessey</author>
      <guid>http://communities.vmware.com/message/960123?tstart=0#960123</guid>
      <dc:date>2008-06-02T14:14:41Z</dc:date>
      <clearspace:dateToText>1 year, 5 months ago</clearspace:dateToText>
      <clearspace:replyCount>7</clearspace:replyCount>
    </item>
  </channel>
</rss>

