{"id":39082,"date":"2024-07-29T10:16:50","date_gmt":"2024-07-29T15:16:50","guid":{"rendered":"https:\/\/verticalagetechnologies.com\/?p=39082"},"modified":"2024-07-29T10:16:52","modified_gmt":"2024-07-29T15:16:52","slug":"citrix-power-state-unknown-gotcha","status":"publish","type":"post","link":"https:\/\/verticalagetechnologies.com\/index.php\/2024\/07\/29\/citrix-power-state-unknown-gotcha","title":{"rendered":"Citrix: Power State &#8220;Unknown&#8221;.  Gotcha!"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If you manage a Citrix environment chances are you&#8217;re using hosting connections to manage power actions.  Whether it&#8217;s for MCS\/PVS, reboot schedules, or to simply perform a reboot or shutdown on VMs from Citrix Studio.  One of the bigger &#8220;Gotchas&#8221; I see is when the power state  changes to &#8216;unknown&#8217;.  This can be due to various reasons.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Deleting the VM at the hypervisor level and creating a new one<\/li>\n\n\n\n<li>Moving the VM to a different cluster<\/li>\n\n\n\n<li>Issues with the Hosting connection, such as expiring service account, expired SSL Certificate, and more<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">There are different fixes for these problems that are mostly well documented.  Just Googling &#8220;Citrix Power State Unknown&#8221; serves up a bunch of different articles and blogs for all the different possible solutions to the problem.  Majority of the time, to find the root cause, you should preform a &#8216;Test Connection&#8217; on the Hosting connection itself from Citrix Studio.  This will perform various connectivity tests to help you understand the reason.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/verticalagetechnologies.com\/wp-content\/uploads\/2024\/07\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"208\" src=\"https:\/\/verticalagetechnologies.com\/wp-content\/uploads\/2024\/07\/image-1-1024x208.png\" alt=\"\" class=\"wp-image-39084\" srcset=\"https:\/\/verticalagetechnologies.com\/wp-content\/uploads\/2024\/07\/image-1-1024x208.png 1024w, https:\/\/verticalagetechnologies.com\/wp-content\/uploads\/2024\/07\/image-1-300x61.png 300w, https:\/\/verticalagetechnologies.com\/wp-content\/uploads\/2024\/07\/image-1-768x156.png 768w, https:\/\/verticalagetechnologies.com\/wp-content\/uploads\/2024\/07\/image-1-1536x311.png 1536w, https:\/\/verticalagetechnologies.com\/wp-content\/uploads\/2024\/07\/image-1.png 1623w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">During the time that the VM has a Power State of Unknown there could be different sorts of conditions where it has &#8216;Pending&#8217; actions.  Maybe from a reboot schedule, the Help Desk performing manual reboots, Automated VDI logoff\/shutdown actions, or any other number of reasons.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What is NOT talked about a lot before you fix the &#8216;unknown&#8217; Power State is checking for any Pending actions.  If this isn&#8217;t done, after you fix the Power State, those pending actions will continue to be processed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:  Say your Citrix hosting connection hypervisor SSL Certificate expired.  You walk through a method in this article <a href=\"https:\/\/support.citrix.com\/s\/article\/CTX224551-delivery-controller-cannot-contact-vcenter-server-after-certificate-update-on-vcenter?language=en_US\">https:\/\/support.citrix.com\/s\/article\/CTX224551-delivery-controller-cannot-contact-vcenter-server-after-certificate-update-on-vcenter?language=en_US<\/a> to fix the issue.  Shortly after, all of your VMs start rebooting due to pending power state actions that were applied from a reboot schedule on the Delivery Group.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/verticalagetechnologies.com\/wp-content\/uploads\/2024\/07\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"337\" height=\"275\" src=\"https:\/\/verticalagetechnologies.com\/wp-content\/uploads\/2024\/07\/image-2.png\" alt=\"\" class=\"wp-image-39085\" srcset=\"https:\/\/verticalagetechnologies.com\/wp-content\/uploads\/2024\/07\/image-2.png 337w, https:\/\/verticalagetechnologies.com\/wp-content\/uploads\/2024\/07\/image-2-300x245.png 300w\" sizes=\"auto, (max-width: 337px) 100vw, 337px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">In order to solve this you need to check for all Pending Power Actions and remove them <strong>before<\/strong> continuing to fix whatever the root cause reason for power state &#8216;unknown&#8217;.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#Get a list of all Pending Power State Actions\nGet-BrokerHostingPowerAction -Filter { State -eq \"Pending\"}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#Get a list of ALL power actions\nGet-brokerhostingpoweraction | Select action, ActionCompletionTime,HostedMachineName,State<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, we&#8217;ll want to remove those Pending Actions.  Here is a good one liner if you&#8217;d like to remove them all.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#Remove all Pending Power Actions\nGet-BrokerHostingPowerAction -Filter { State -eq \"Pending\"} | Remove-BrokerHostingPowerAction<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After the Pending Power Actions have been removed, then proceed to fixing the Power State.  Hope this helps prevent some unwanted reboots for you folks.<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you manage a Citrix environment chances are you&#8217;re using hosting connections to manage power actions. Whether it&#8217;s for MCS\/PVS, reboot schedules, or to simply perform a reboot or shutdown on VMs from Citrix Studio. One of the bigger &#8220;Gotchas&#8221; I see is when the power state changes to &#8216;unknown&#8217;. This can be due to&#8230;<\/p>\n","protected":false},"author":1,"featured_media":39085,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[8,12],"tags":[],"class_list":["post-39082","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-citrix","category-xendesktopxenapp"],"_links":{"self":[{"href":"https:\/\/verticalagetechnologies.com\/index.php\/wp-json\/wp\/v2\/posts\/39082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/verticalagetechnologies.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/verticalagetechnologies.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/verticalagetechnologies.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/verticalagetechnologies.com\/index.php\/wp-json\/wp\/v2\/comments?post=39082"}],"version-history":[{"count":6,"href":"https:\/\/verticalagetechnologies.com\/index.php\/wp-json\/wp\/v2\/posts\/39082\/revisions"}],"predecessor-version":[{"id":39091,"href":"https:\/\/verticalagetechnologies.com\/index.php\/wp-json\/wp\/v2\/posts\/39082\/revisions\/39091"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/verticalagetechnologies.com\/index.php\/wp-json\/wp\/v2\/media\/39085"}],"wp:attachment":[{"href":"https:\/\/verticalagetechnologies.com\/index.php\/wp-json\/wp\/v2\/media?parent=39082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/verticalagetechnologies.com\/index.php\/wp-json\/wp\/v2\/categories?post=39082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/verticalagetechnologies.com\/index.php\/wp-json\/wp\/v2\/tags?post=39082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}