{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/xHyper-V/issues/159","repository_url":"https://api.github.com/repos/PowerShell/xHyper-V","labels_url":"https://api.github.com/repos/PowerShell/xHyper-V/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/xHyper-V/issues/159/comments","events_url":"https://api.github.com/repos/PowerShell/xHyper-V/issues/159/events","html_url":"https://github.com/PowerShell/xHyper-V/issues/159","id":373518494,"node_id":"MDU6SXNzdWUzNzM1MTg0OTQ=","number":159,"title":"xVMHyperV: RestartIfNeeded not setting properly","user":{"login":"jaykeblakk","id":38302718,"node_id":"MDQ6VXNlcjM4MzAyNzE4","avatar_url":"https://avatars1.githubusercontent.com/u/38302718?v=4","gravatar_id":"","url":"https://api.github.com/users/jaykeblakk","html_url":"https://github.com/jaykeblakk","followers_url":"https://api.github.com/users/jaykeblakk/followers","following_url":"https://api.github.com/users/jaykeblakk/following{/other_user}","gists_url":"https://api.github.com/users/jaykeblakk/gists{/gist_id}","starred_url":"https://api.github.com/users/jaykeblakk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaykeblakk/subscriptions","organizations_url":"https://api.github.com/users/jaykeblakk/orgs","repos_url":"https://api.github.com/users/jaykeblakk/repos","events_url":"https://api.github.com/users/jaykeblakk/events{/privacy}","received_events_url":"https://api.github.com/users/jaykeblakk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-24T14:40:08Z","updated_at":"2018-11-23T15:11:10Z","closed_at":null,"author_association":"NONE","body":"Building a VM and then setting the property RestartIfNeeded to $true does nothing, and it remains false.\r\n\r\nHere is an example of the code:\r\n\r\n\t\txVHD TestHD\r\n\t\t{\r\n\t\t\tEnsure = \"Present\"\r\n\t\t\tName = \"Test.vhdx\"\r\n\t\t\tPath = \"F:\\Test\\Virtual Hard Disks\"\r\n\t\t\tGeneration = \"vhdx\"\r\n\t\t\tMaximumSizeBytes = 256GB\r\n\t\t}\r\n\r\n\t\txVMHyperV TestVM\r\n\t\t{\r\n\t\t\tEnsure = \"Present\"\r\n\t\t\tDependsOn = \"[xVHD]TestHD\"\r\n\t\t\tName = \"Test\"\r\n\t\t\tVhdPath = \"F:\\Test\\Virtual Hard Disks\\Test.vhdx\"\r\n\t\t\tSwitchName = \"Internal Switch 2\"\r\n\t\t\tPath = \"F:\\Test\"\r\n\t\t\tGeneration = 2\r\n\t\t\tStartupMemory = 16GB\r\n\t\t\tProcessorCount = '8'\r\n\t\t\tRestartIfNeeded = $true\r\n\t\t\tState = 'Running'\r\n\t\t}\r\n\r\n\t\txVMScsiController TestSCSI\r\n\t\t{\r\n\t\t\tEnsure = \"Present\"\r\n\t\t\tVMName = \"Test\"\r\n\t\t\tDependsOn = \"[xVHD]TestHD\"\r\n\t\t\tControllerNumber = 0\r\n\t\t}\r\n\r\nThe vhdx is created properly and throws no errors. The VM is then created without throwing any errors. However, when the DSC runs to create the SCSI controller, I receive the following output:\r\n\r\nVERBOSE: [TESTENVIRONMENT]: LCM:  [ Start  Test     ]  [[xVMScsiController]TestSCSI]\r\nVERBOSE: [TESTENVIRONMENT]:                            [[xVMScsiController]TestSCSI] Found controller '0' attached to VM 'Test'.\r\nVERBOSE: [TESTENVIRONMENT]:                            [[xVMScsiController]TestSCSI] Comparing 'RestartIfNeeded'; expected '', actual 'False'.\r\nVERBOSE: [TESTENVIRONMENT]:                            [[xVMScsiController]TestSCSI] Comparing 'ControllerNumber'; expected '0', actual '0'.\r\nVERBOSE: [TESTENVIRONMENT]:                            [[xVMScsiController]TestSCSI] Comparing 'VMName'; expected 'Test', actual 'Test'.\r\nVERBOSE: [TESTENVIRONMENT]:                            [[xVMScsiController]TestSCSI] Comparing 'Ensure'; expected 'Present', actual 'Present'.\r\nVERBOSE: [TESTENVIRONMENT]: LCM:  [ End    Test     ]  [[xVMScsiController]TestSCSI]  in 0.1560 seconds.\r\nVERBOSE: [TESTENVIRONMENT]: LCM:  [ Start  Set      ]  [[xVMScsiController]TestSCSI]\r\nVERBOSE: [TESTENVIRONMENT]: LCM:  [ End    Set      ]  [[xVMScsiController]TestSCSI]  in 0.0630 seconds.\r\nPowerShell DSC resource MSFT_xVMScsiController  failed to execute Set-TargetResource functionality with error message: Cannot update a running VM unless 'RestartIfNeeded' is set to true.\r\n    + CategoryInfo          : InvalidOperation: (:) [], CimException\r\n    + FullyQualifiedErrorId : ProviderOperationExecutionFailure\r\n    + PSComputerName        : testenvironment\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/PowerShell/xHyper-V/issues/comments/441264377","html_url":"https://github.com/PowerShell/xHyper-V/issues/159#issuecomment-441264377","issue_url":"https://api.github.com/repos/PowerShell/xHyper-V/issues/159","id":441264377,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTI2NDM3Nw==","user":{"login":"stale[bot]","id":26384082,"node_id":"MDM6Qm90MjYzODQwODI=","avatar_url":"https://avatars3.githubusercontent.com/in/1724?v=4","gravatar_id":"","url":"https://api.github.com/users/stale%5Bbot%5D","html_url":"https://github.com/apps/stale","followers_url":"https://api.github.com/users/stale%5Bbot%5D/followers","following_url":"https://api.github.com/users/stale%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/stale%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/stale%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stale%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/stale%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/stale%5Bbot%5D/repos","events_url":"https://api.github.com/users/stale%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/stale%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-11-23T15:11:10Z","updated_at":"2018-11-23T15:11:10Z","author_association":"NONE","body":"This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 10 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close.\n"}}
{"actor":{"display_login":"stale"}}