tag:blogger.com,1999:blog-2269516327950490847.post7966246564939815926..comments2023-03-28T08:39:06.775-04:00Comments on vNugglets: Backup/Export Full DRS Rule Info via PowerShellAC (@allen_crawford)http://www.blogger.com/profile/05360032132878174436noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-2269516327950490847.post-52807685883119879312020-01-20T09:35:01.198-05:002020-01-20T09:35:01.198-05:00Greetings, Mathiau-
Thanks! Yes, while this beaut...Greetings, Mathiau-<br /><br />Thanks! Yes, while this beauty should still work a dream, it is deprecated in favor of the full-on PowerShell module for such things: the "DRSRule" PowerShell module. Luc Dekens and I wrote said PowerShell module to handle imports and much more -- managing/exporting/importing DRS Rules and Groups. See our posts at http://www.lucd.info/2015/01/22/drsrule-drs-rules-and-groups-module and http://www.vnugglets.com/2015/01/drsrule-new-powershell-module-for-drs.html.<br /><br />And, particularly for your use cases, see the Export-DrsRule and Import-DrsRule cmdlets in the module. Enjoy!MattBoren (@mtboren)https://www.blogger.com/profile/08371304528581535245noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-11978582885110057772020-01-17T17:48:50.733-05:002020-01-17T17:48:50.733-05:00Great looking script, is this still valid in 2020?...Great looking script, is this still valid in 2020? Tried to use it on vCenter 6.7u3 and received this error:<br /><br />"Get-View : Cannot validate argument on parameter 'Id'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again."<br /><br />Desktop\DRSBackups-Working.ps1:31 char:78<br />+ ... ty Name -Id ($viewCurrClus.ConfigurationEx.Group | ?{($_ -is [VMware. ...<br /><br />Line 31 is:<br /> $oRuleInfo.VMGroupMembers = (Get-View -Property Name -Id ($viewCurrClus.ConfigurationEx.Group | ?{($_ -is [VMware.Vim.ClusterVmGroup]) -and ($_.Name -eq $oRuleInfo.VMGroupName)}).Vm | %{$_.Name}) -join ","Mathiaunoreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-9198918561458936012017-10-23T20:49:57.435-04:002017-10-23T20:49:57.435-04:00Hello, Guocai Liang-
The DRSRule PowerShell modul...Hello, Guocai Liang-<br /><br />The DRSRule PowerShell module supercedes the code in this post. Luc Dekens and I wrote said PowerShell module for managing/exporting/importing DRS Rules and Groups. See our posts at http://www.lucd.info/2015/01/22/drsrule-drs-rules-and-groups-module and http://www.vnugglets.com/2015/01/drsrule-new-powershell-module-for-drs.html.<br /><br />And, if you find issues with the module, or have some feature requests, or want to contribute, check out the module at GitHub at https://github.com/PowerCLIGoodies/DRSRule.<br /><br />Cheers! MattMattBoren (@mtboren)https://www.blogger.com/profile/08371304528581535245noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-90078340543459774502017-10-23T20:46:18.927-04:002017-10-23T20:46:18.927-04:00Hello, Owengo@qq-
Thanks! As for importing from ...Hello, Owengo@qq-<br /><br />Thanks! As for importing from exports: the way to go now would to be to use the DRSRule PowerShell module that supercedes the code in this post. Luc Dekens and I wrote said PowerShell module to handle imports and much more -- managing/exporting/importing DRS Rules and Groups. See our posts at http://www.lucd.info/2015/01/22/drsrule-drs-rules-and-groups-module and http://www.vnugglets.com/2015/01/drsrule-new-powershell-module-for-drs.html.<br /><br />And, particularly for your use cases, see the Export-DrsRule and Import-DrsRule cmdlets in the module. Enjoy!MattBoren (@mtboren)https://www.blogger.com/profile/08371304528581535245noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-65713660883060924662017-10-19T03:12:24.369-04:002017-10-19T03:12:24.369-04:00Hi all ,I got same problem and did you fix this is...Hi all ,I got same problem and did you fix this issue ?? if fix this issue can you share me the way to me?my email address is owengo@qq.comEthan9909https://www.blogger.com/profile/04231872634839347957noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-70317373878689886982017-09-15T00:49:56.068-04:002017-09-15T00:49:56.068-04:00Good job! Could you please tell me how to import t...Good job! Could you please tell me how to import the rule from exported csv files?<br /><br />My email is owengo@qq.com.Thanks for your help.<br />Ethan9909https://www.blogger.com/profile/04231872634839347957noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-56694010996488078402016-01-29T08:28:17.724-05:002016-01-29T08:28:17.724-05:00Great script!Great script!wojciehhttps://www.blogger.com/profile/12724285456031807877noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-91056633924915724112015-03-24T21:08:30.532-04:002015-03-24T21:08:30.532-04:00Hello, Anonymous-
If you didn't see, Luc Deke...Hello, Anonymous-<br /><br />If you didn't see, Luc Dekens and I wrote a PowerShell module to handle imports and much more -- managing/exporting/importing DRS Rules and Groups. See our posts at http://www.lucd.info/2015/01/22/drsrule-drs-rules-and-groups-module and http://www.vnugglets.com/2015/01/drsrule-new-powershell-module-for-drs.html. Enjoy!MattBoren (@mtboren)https://www.blogger.com/profile/08371304528581535245noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-88869621869741965612014-12-30T11:35:09.618-05:002014-12-30T11:35:09.618-05:00Any update on the import script? I'm looking ...Any update on the import script? I'm looking to migrate a datacenter/cluster to a new vcenter and the import would greatly help.<br /><br />Thanks!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-46635725717013707952014-07-16T17:48:01.257-04:002014-07-16T17:48:01.257-04:00To get all group membership I was able to use the ...To get all group membership I was able to use the Get-DrsGroup function located here https://communities.vmware.com/message/1699823#1699823<br /><br />and run these commands...<br /><br />foreach ($group in (Get-DrsGroup -Cluster "ClusterName")) {<br /> $group.Name<br /> foreach ($obj in $group.vm) {<br /> (get-view -id $obj).name<br /> }<br /> foreach ($obj in $group.host) {<br /> (get-view -id $obj).name<br /> }<br /> Write-Output ""<br />}Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-54166703480706578752014-07-16T17:18:44.418-04:002014-07-16T17:18:44.418-04:00A downfall to this script I noticed is that it won...A downfall to this script I noticed is that it won't export any groups that are not used. I have a few DRS groups defined but they aren't currently used in any rules. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-48838823554980426482014-07-16T17:17:51.978-04:002014-07-16T17:17:51.978-04:00I received this same error. It was because one of ...I received this same error. It was because one of my DRS groups didn't actually have any members. I was able to ignore the message. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-18028182636853345642014-07-14T14:47:08.597-04:002014-07-14T14:47:08.597-04:00Is that the cause of the following error?
Get-Vie...Is that the cause of the following error?<br /><br />Get-View : Cannot validate argument on parameter 'Id'. The argument is null or empty. Provide an argument that is not null or empty, and then try the <br />command again.<br />At line:30 char:78<br />+ $oRuleInfo.VMGroupMembers = (Get-View -Property Name -Id ($v ...<br />+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br /> + CategoryInfo : InvalidData: (:) [Get-View], ParameterBindingValidationException<br /> + FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIViewAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-39920708165393169302014-02-07T15:28:39.042-05:002014-02-07T15:28:39.042-05:00Excellent Script. Thank you. It does throw some mi...Excellent Script. Thank you. It does throw some minor (ignoreable) errors for those clusters that it cannot find Host/VM groups for. i.e. that only have vm anti or affinity rules but not groups. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-4845409728992273742013-09-30T05:35:44.235-04:002013-09-30T05:35:44.235-04:00Hi there!
Totally awesome script! Thank you for y...Hi there!<br /><br />Totally awesome script! Thank you for your good work! Do you plan on making a restore-script anytime soon? :-)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-80701945500491601302013-04-08T17:19:42.510-04:002013-04-08T17:19:42.510-04:00This Script is fast and gets the job done!
Please ...This Script is fast and gets the job done!<br />Please post the Restore script to match ASAP!<br /><br />NickAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-81337871793193953862013-03-20T21:04:37.820-04:002013-03-20T21:04:37.820-04:00Thanks for the feedback, Tom. One day we will get...Thanks for the feedback, Tom. One day we will get around to posting the complementary Restore/Import kin article...MattBoren (@mtboren)https://www.blogger.com/profile/08371304528581535245noreply@blogger.comtag:blogger.com,1999:blog-2269516327950490847.post-8321245266162643102013-03-18T04:33:10.437-04:002013-03-18T04:33:10.437-04:00This is great! Thanks.
TomThis is great! Thanks.<br /><br />TomTomhttps://www.blogger.com/profile/11722159477947581259noreply@blogger.com