<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Answer the question!	</title>
	<atom:link href="https://www.lucd.info/2015/10/02/answer-the-question/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.lucd.info/2015/10/02/answer-the-question/</link>
	<description>My PowerShell ramblings</description>
	<lastBuildDate>Thu, 17 Aug 2023 06:24:08 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/><atom:link rel="hub" href="https://websubhub.com/hub"/>	<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2015/10/02/answer-the-question/#comment-23329</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Thu, 17 Aug 2023 06:24:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=4970#comment-23329</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2015/10/02/answer-the-question/#comment-23322&quot;&gt;Scott&lt;/a&gt;.

If you do not unmount the CD first from within the Guest OS this can happen.
And yes, afaik this is a known issue.]]></description>
			<content:encoded><![CDATA[<p>If you do not unmount the CD first from within the Guest OS this can happen.<br />
And yes, afaik this is a known issue.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Scott		</title>
		<link>https://www.lucd.info/2015/10/02/answer-the-question/#comment-23322</link>

		<dc:creator><![CDATA[Scott]]></dc:creator>
		<pubDate>Wed, 16 Aug 2023 23:09:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=4970#comment-23322</guid>

					<description><![CDATA[Hi Luc,
        Got a related question for you... When I attempted to unmount an ISO from a Redhat PC recently, the entire time vCenter was asking me to &quot;Answer Question&quot; the CPU/RAM/HDD all dropped to 0.  It was acting like the system was halted, but I could still ping it.  As soon as I answered the question, the system was responsive again.  Do you know if this is working as intended, or perhaps has anybody else in the comments ever encountered that?  Your script could be a nice workaround for scenarios like this, but it feels like a bug to me not to be able to unmount a CD in a production environment.]]></description>
			<content:encoded><![CDATA[<p>Hi Luc,<br />
        Got a related question for you&#8230; When I attempted to unmount an ISO from a Redhat PC recently, the entire time vCenter was asking me to &#8220;Answer Question&#8221; the CPU/RAM/HDD all dropped to 0.  It was acting like the system was halted, but I could still ping it.  As soon as I answered the question, the system was responsive again.  Do you know if this is working as intended, or perhaps has anybody else in the comments ever encountered that?  Your script could be a nice workaround for scenarios like this, but it feels like a bug to me not to be able to unmount a CD in a production environment.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2015/10/02/answer-the-question/#comment-21699</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Wed, 05 Apr 2023 10:53:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=4970#comment-21699</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2015/10/02/answer-the-question/#comment-21698&quot;&gt;JDMils&lt;/a&gt;.

Thanks for reporting that typo, I changed VM to Name.

The error you are getting might be related to &lt;a href=&quot;https://kb.vmware.com/s/article/79306&quot; target=&quot;_blank&quot; rel=&quot;noopener nofollow ugc&quot;&gt;KB79306&lt;/a&gt;
Can you try the Solution mentioned in that KB?]]></description>
			<content:encoded><![CDATA[<p>Thanks for reporting that typo, I changed VM to Name.</p>
<p>The error you are getting might be related to <a href="https://kb.vmware.com/s/article/79306" target="_blank" rel="noopener nofollow ugc">KB79306</a><br />
Can you try the Solution mentioned in that KB?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: JDMils		</title>
		<link>https://www.lucd.info/2015/10/02/answer-the-question/#comment-21698</link>

		<dc:creator><![CDATA[JDMils]]></dc:creator>
		<pubDate>Wed, 05 Apr 2023 10:29:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=4970#comment-21698</guid>

					<description><![CDATA[Hi LucD, I tried the code and it did not work for me. I tried the following:
set-cddriveandanswer -Name MyVMWithACDROM

And it just sits there and in the vCenter, the VM is waiting for a response to the dreaded &quot;Disconnect anyway and override the lock?&quot; question.

I then get the timeout error:
Set-CDDrive : 5/04/2023 8:26:46 PM	Set-CDDrive		The operation for the entity &quot;MyVMWithACDROM&quot; failed with the following message: &quot;Connection control operation failed for disk &#039;ide1:0&#039;.&quot;. Connection control operation failed for disk 
&#039;ide1:0&#039;.	
At C:\Users\jmilano\Documents\PowerShell_Scripts\AnswerCDROMQuestion.ps1:52 char:1
+ Set-CDDrive -CD $cd -NoMedia -Confirm:$false -ErrorAction Stop
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Set-CDDrive], GenericVmConfigFault
    + FullyQualifiedErrorId : Client20_TaskServiceImpl_CheckServerSideTaskUpdates_OperationFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.SetCDDrive


I also noticed your sample code used to run the script shows the command:
Set-CDDriveAndAnswer -VM LinuxBox

However the name of the VM to disconnect the CDROM is actually passed to the Name parameter so the command should be:
Set-CDDriveAndAnswer -Name LinuxBox

But I guess this is a result of lots of testing and code changes along the way. Something small.]]></description>
			<content:encoded><![CDATA[<p>Hi LucD, I tried the code and it did not work for me. I tried the following:<br />
set-cddriveandanswer -Name MyVMWithACDROM</p>
<p>And it just sits there and in the vCenter, the VM is waiting for a response to the dreaded &#8220;Disconnect anyway and override the lock?&#8221; question.</p>
<p>I then get the timeout error:<br />
Set-CDDrive : 5/04/2023 8:26:46 PM	Set-CDDrive		The operation for the entity &#8220;MyVMWithACDROM&#8221; failed with the following message: &#8220;Connection control operation failed for disk &#8216;ide1:0&#8217;.&#8221;. Connection control operation failed for disk<br />
&#8216;ide1:0&#8217;.<br />
At C:\Users\jmilano\Documents\PowerShell_Scripts\AnswerCDROMQuestion.ps1:52 char:1<br />
+ Set-CDDrive -CD $cd -NoMedia -Confirm:$false -ErrorAction Stop<br />
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
    + CategoryInfo          : NotSpecified: (:) [Set-CDDrive], GenericVmConfigFault<br />
    + FullyQualifiedErrorId : Client20_TaskServiceImpl_CheckServerSideTaskUpdates_OperationFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.SetCDDrive</p>
<p>I also noticed your sample code used to run the script shows the command:<br />
Set-CDDriveAndAnswer -VM LinuxBox</p>
<p>However the name of the VM to disconnect the CDROM is actually passed to the Name parameter so the command should be:<br />
Set-CDDriveAndAnswer -Name LinuxBox</p>
<p>But I guess this is a result of lots of testing and code changes along the way. Something small.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2015/10/02/answer-the-question/#comment-21354</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Fri, 17 Feb 2023 15:39:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=4970#comment-21354</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2015/10/02/answer-the-question/#comment-21351&quot;&gt;Mohamed&lt;/a&gt;.

I&#039;m afraid not yet.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m afraid not yet.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mohamed		</title>
		<link>https://www.lucd.info/2015/10/02/answer-the-question/#comment-21351</link>

		<dc:creator><![CDATA[Mohamed]]></dc:creator>
		<pubDate>Fri, 17 Feb 2023 13:56:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=4970#comment-21351</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2015/10/02/answer-the-question/#comment-4866&quot;&gt;LucD&lt;/a&gt;.

Hi LucD, have you found a solution for this? I have the same issue Ray describe]]></description>
			<content:encoded><![CDATA[<p>Hi LucD, have you found a solution for this? I have the same issue Ray describe</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2015/10/02/answer-the-question/#comment-21074</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Thu, 19 Jan 2023 19:49:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=4970#comment-21074</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2015/10/02/answer-the-question/#comment-21072&quot;&gt;Toni Polster&lt;/a&gt;.

Just to understand, are you referring to the Windows Task Scheduler?
And how exactly do you schedule your PS code? User account, PS command line or script, ...]]></description>
			<content:encoded><![CDATA[<p>Just to understand, are you referring to the Windows Task Scheduler?<br />
And how exactly do you schedule your PS code? User account, PS command line or script, &#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Toni Polster		</title>
		<link>https://www.lucd.info/2015/10/02/answer-the-question/#comment-21072</link>

		<dc:creator><![CDATA[Toni Polster]]></dc:creator>
		<pubDate>Thu, 19 Jan 2023 19:35:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=4970#comment-21072</guid>

					<description><![CDATA[Thank you, the function works great ... if you use the option &#039;button.yes&#039;.
Unfortunately, my script breaks permanently as soon as it is executed via the task scheduler.

If you remove the line
&quot;Connect-VIServer -Server $vServer.Name -Session $vServer.SessionSecret &#124; Out-Null&quot;
the script will run, but the vSphere question will not be captured/answered.

For info:
The try/catch variant from these threads does not work for me, as no exception is thrown.

Is there a solution that can be used via the task scheduler?]]></description>
			<content:encoded><![CDATA[<p>Thank you, the function works great &#8230; if you use the option &#8216;button.yes&#8217;.<br />
Unfortunately, my script breaks permanently as soon as it is executed via the task scheduler.</p>
<p>If you remove the line<br />
&#8220;Connect-VIServer -Server $vServer.Name -Session $vServer.SessionSecret | Out-Null&#8221;<br />
the script will run, but the vSphere question will not be captured/answered.</p>
<p>For info:<br />
The try/catch variant from these threads does not work for me, as no exception is thrown.</p>
<p>Is there a solution that can be used via the task scheduler?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: LucD		</title>
		<link>https://www.lucd.info/2015/10/02/answer-the-question/#comment-17341</link>

		<dc:creator><![CDATA[LucD]]></dc:creator>
		<pubDate>Fri, 26 Aug 2022 09:00:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=4970#comment-17341</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2015/10/02/answer-the-question/#comment-17337&quot;&gt;Julian Milano&lt;/a&gt;.

That is a valid alternative.

In fact, my solution does something similar, it runs code in the background that polls for the question, and then tries to answer it.
Sometimes that background task might fail I noticed.]]></description>
			<content:encoded><![CDATA[<p>That is a valid alternative.</p>
<p>In fact, my solution does something similar, it runs code in the background that polls for the question, and then tries to answer it.<br />
Sometimes that background task might fail I noticed.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Julian Milano		</title>
		<link>https://www.lucd.info/2015/10/02/answer-the-question/#comment-17337</link>

		<dc:creator><![CDATA[Julian Milano]]></dc:creator>
		<pubDate>Fri, 26 Aug 2022 08:04:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.lucd.info/?p=4970#comment-17337</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.lucd.info/2015/10/02/answer-the-question/#comment-17332&quot;&gt;Julian Milano&lt;/a&gt;.

I&#039;m trying to figger out how LucD&#039;s code works and I guess it tries to disconnect the CDROM then launches another process to answer the question?

The reason I ask this is that when I run the command:
 Set-CDDrive -CD $cd -NoMedia -Confirm:$false

The VM Summary screen shows the question and is waiting for an answer. 

I then opened another PowerShell command dialog, connected to the same vCenter as the VM in question, and ran the following:

PS C:\Users\MyUsername&#062; get-vmquestion

Text                                               Options              Default
----                                               -------              -------
The guest operating system has locked the CD-ROM   {button.yes,         button.no
door and is probably using the CD-ROM, which can   button.no}
prevent the guest from recognizing media changes.
If possible, eject the CD-ROM from inside the
guest before disconnecting. Disconnect anyway and
override the lock?


PS C:\Users\MyUsername&#062;

I then ran this command and the CDROM unlocked:
Set-VMQuestion -VMQuestion $question -Option &quot;button.yes&quot; -Confirm:$false

So I guess if I could load a new process which delays by 10 seconds, then queries the question on the VM and then answers it with &quot;button.yes&quot; and shuts down, this would work, but I&#039;m not sure how to code this.

The VM I am testing with has the following properties set:
Connected To: Host Image File
File: [] MyImageFile.iso]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying to figger out how LucD&#8217;s code works and I guess it tries to disconnect the CDROM then launches another process to answer the question?</p>
<p>The reason I ask this is that when I run the command:<br />
 Set-CDDrive -CD $cd -NoMedia -Confirm:$false</p>
<p>The VM Summary screen shows the question and is waiting for an answer. </p>
<p>I then opened another PowerShell command dialog, connected to the same vCenter as the VM in question, and ran the following:</p>
<p>PS C:\Users\MyUsername&gt; get-vmquestion</p>
<p>Text                                               Options              Default<br />
&#8212;-                                               &#8212;&#8212;-              &#8212;&#8212;-<br />
The guest operating system has locked the CD-ROM   {button.yes,         button.no<br />
door and is probably using the CD-ROM, which can   button.no}<br />
prevent the guest from recognizing media changes.<br />
If possible, eject the CD-ROM from inside the<br />
guest before disconnecting. Disconnect anyway and<br />
override the lock?</p>
<p>PS C:\Users\MyUsername&gt;</p>
<p>I then ran this command and the CDROM unlocked:<br />
Set-VMQuestion -VMQuestion $question -Option &#8220;button.yes&#8221; -Confirm:$false</p>
<p>So I guess if I could load a new process which delays by 10 seconds, then queries the question on the VM and then answers it with &#8220;button.yes&#8221; and shuts down, this would work, but I&#8217;m not sure how to code this.</p>
<p>The VM I am testing with has the following properties set:<br />
Connected To: Host Image File<br />
File: [] MyImageFile.iso</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
