-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.json
1 lines (1 loc) · 48.4 KB
/
index.json
1
[{"body":"","link":"https://www.immiblogghenicloud.cloud/tags/aria/","section":"tags","tags":null,"title":"ARIA"},{"body":"INTRO A few days ago, while testing VMware ARIA Operations 8.14.1, I came across this alert: \u0026quot;FSDB file corruption detected.\u0026quot; Typically, this suggests potential corruption within the directory /storage/db/vcops/data/. Searching online, I found VMware's KB2126139, which advises deleting the alert and contacting support if it reoccurs. I've decided to write this article to share some insights on the matter.\nISSUE This message suggests potential corruption within the directory /storage/db/vcops/data/. The corruption of these files could have been caused by an unexpected poweroff, a VM crash, or the filling of the database partition. Therefore, the first step is to ensure that the disk space of the database is not exhausted.\nTo proceed with cleaning or expanding the disk space of VMware Aria Operations, you can follow the KB2093903 and KB2016022.\nAfter verifying that there is sufficient disk space, we can check for corrupted files on the filesystem. Once connected via SSH to the node with the analytics service, we can use the following command:\n1find /storage/db/vcops/data/ -type f -not -regex \u0026#39;.*/[2][0][2][0-3]_[0-9][0-9]_.*.dat\u0026#39; -and ! -regex \u0026#39;.*/[2][0][1][7-9]_[0-9][0-9]_.*.dat\u0026#39; -and ! -name \u0026#39;*dtr\u0026#39; -and ! -name \u0026#39;mps_*\u0026#39; Note The command should return two files which can be ignored, these have been left in to confirm the command ran successfully.\n1/storage/db/vcops/data/cache/0.cache 2/storage/db/vcops/data/cache/.lock An example of a corrupted file name is as follows:\n1/usr/lib/vmware-vcops/data/8/8584/163603858_02_8584.dat Note the future timestamp.\nAn example of a valid file name is as follows:\n1/usr/lib/vmware-vcops/data/10/10718/2020_10_10718.dat Note the relatable timestamp.\nLet's make a note of all the names of the files that appear corrupted.\nInfo In some cases, it's possible to come across files with dates before 2000; these files can be safely deleted without any issues.\nRESOLUTION After noting down the files to be deleted, we proceed by taking the cluster offline from the Admin UI and then shutting down the nodes from vCenter. We create a snapshot of the powered-off VM. Immediately after powering on the VM, we log in via SSH while the cluster is still offline and proceed with the removal of the corrupted files using the rm command.\nExample\n1rm /usr/lib/vmware-vcops/data/8/8584/163603858_02_8584.dat Next, we proceed by clearing the cache on all analytics nodes using the command:\n1rm /usr/lib/vmware-vcops/data/cache/*.cache Now we can restart the services and verify that everything is okay. If the alert persists, it might be necessary to manually delete the alert.\nIn some cases, the corrupted files might not be present, and simply cleaning the cache of the offline cluster nodes is sufficient.\nBy following these steps, you can efficiently address and resolve the issue of corrupted FSDB files in VMware Aria Operations, ensuring your analytics nodes are functioning correctly.\nHave you faced a similar FSDB file corruption issue in VMware ARIA Operations, or do you have any troubleshooting tips to share? I would love to hear about your experiences and any advice you might have. Please leave your thoughts and questions in the comments below, or if you found this post helpful, consider sharing it on social media. Your feedback not only helps me improve but also assists others in the community dealing with similar challenges.\n","link":"https://www.immiblogghenicloud.cloud/posts/aria-operations-fsdb-corruption/","section":"posts","tags":["VMWARE","ARIA","OPERATIONS","TROUBLESHOOTING"],"title":"Aria Operations - FSDB file corruption detected"},{"body":"","link":"https://www.immiblogghenicloud.cloud/categories/","section":"categories","tags":null,"title":"Categories"},{"body":"","link":"https://www.immiblogghenicloud.cloud/","section":"","tags":null,"title":"IMMIBLOGGHENICLOUD"},{"body":"","link":"https://www.immiblogghenicloud.cloud/tags/operations/","section":"tags","tags":null,"title":"OPERATIONS"},{"body":"","link":"https://www.immiblogghenicloud.cloud/posts/","section":"posts","tags":null,"title":"Posts"},{"body":"","link":"https://www.immiblogghenicloud.cloud/tags/","section":"tags","tags":null,"title":"Tags"},{"body":"","link":"https://www.immiblogghenicloud.cloud/tags/troubleshooting/","section":"tags","tags":null,"title":"TROUBLESHOOTING"},{"body":"","link":"https://www.immiblogghenicloud.cloud/categories/vmware/","section":"categories","tags":null,"title":"VMware"},{"body":"","link":"https://www.immiblogghenicloud.cloud/tags/vmware/","section":"tags","tags":null,"title":"VMWARE"},{"body":"Intro To add notes to the VM in vSphere by inserting them during the deployment request in Aria Automation, we can create an Aria Orchestrator Workflow that will allow us to modify the VM post-deploy.\nThis Workflow will then be activated using the Extensibility Subscriptions of Automation, triggered by Compute Post Provisioning.\nBlueprint preparation Let's proceed by modifying our Blueprint so it accepts input notes with a field of type String.\nHere is an example of the code for the Notes section:\n1formatVersion: 1 2inputs: 3 Name: 4 type: string 5 title: Name 6 Notes: 7 type: string 8 title: Notes 9 Image: 10 type: string 11 title: Image 12 oneOf: 13 - title: WIN-2019-TEMPLATE 14 const: WIN-2019-TEMPLATE 15 default: WIN-2019-TEMPLATE 16resources: 17 Cloud_vSphere_Machine_1: 18 type: Cloud.vSphere.Machine 19 properties: 20 name: ${input.Name} 21 image: ${input.Image} 22 flavor: small 23 VMnotes: ${input.Notes} In this way, the deployment will have the value VMnotes as CustomProperties.\nOrchestrator Workflow Let's now prepare the Workflow, which will primarily consist of 2 JavaScript scripts and a Workflow Element.\nAs variables, we have:\nAnd as Input/Output, we have:\nNow let's move to the schema of the Workflow\nThe code for the 'Get properties' script is as follows:\n1var resourceName = inputProperties.get(\u0026#34;resourceNames\u0026#34;); 2var newnote = inputProperties.get(\u0026#39;customProperties\u0026#39;).get(\u0026#39;VMnotes\u0026#39;); 3 4System.log(\u0026#34;VM Name: \u0026#34; + resourceName[0]); 5 6VMresourceName = resourceName[0]; 7VMnewNote = newnote; And this is the configuration of the script element:\nThe configuration of the Workflow Element \u0026quot;Get virtual machines by name\u0026quot; is as follows:\nWhile this is the code and configuration for the 'Add Notes' script:\n1var vm = vmObject[0]; 2var newNotes = VMnewNote; 3var task; 4 5try { 6 var vmConfigSpec = new VcVirtualMachineConfigSpec(); 7 vmConfigSpec.annotation = newNotes; 8 task = vm.reconfigVM_Task(vmConfigSpec); 9} 10catch (ex) { 11 System.error(\u0026#34;Error updating VM notes: \u0026#34; + ex); 12} This is everything needed for the Workflow! Now we should use an Extensibility Subscription to execute it every time a VM is deployed.\nExtensibility Subscription I won’t go into much detail about the Subscription, just keep in mind that the configuration will be similar to this\nExecution post deploy Let's see the result of the Workflow execution triggered by our Subscription.\nAnd this is the execution result!\n","link":"https://www.immiblogghenicloud.cloud/posts/add-notes-in-vsphere-vm-aria-automation/","section":"posts","tags":["VMWARE","VRA","VRO","ARIA"],"title":"Add Notes in vSphere Vm - Aria Automation"},{"body":"","link":"https://www.immiblogghenicloud.cloud/tags/vra/","section":"tags","tags":null,"title":"VRA"},{"body":"","link":"https://www.immiblogghenicloud.cloud/tags/vro/","section":"tags","tags":null,"title":"VRO"},{"body":"Intro Recently, I was asked to create several Blueprints that would display the resource price at the time of the request through the Service Broker. This had to be accomplished without using VMware Aria Automation Pricing Cards.\nThe need was to showcase templates with these features:\nTemplate Azure OS: Windows And Linux 3 Flavours: Small, Medium and Large Managed or Unamanged Machine (SLA) In case the vm is managed you have Monitoring SLA - STD or H24 Template GCP OS: Windows And Linux 3 Flavours: Small, Medium And Large Managed or Unamanged Machine (SLA) In case the vm is managed you have Monitoring SLA - STD or H24 Template vCenter Windows OS: Windows 2019 or 2022 3 Flavours: Small, Medium And Large Managed or Unamanged Machine (SLA) In case the vm is managed you have Monitoring SLA - STD or H24 The price varies depending on the Flavour, the operating system, whether it is Managed or Unmanaged, and the type of SLA if the VM is managed.\nTo enable the most flexible management of future price updates, my solution was to read the prices from a CSV file using PowerShell.\nResource Preparation Blueprints Let's take a look at the 3 Blueprints I have prepared:\nvCenter Windows Blueprint This Blueprint involves deploying a VM, in this case, a Windows VM, and specifies which vCenter and Storage to allocate it to.\n'Managed' refers to a production VM that needs to be monitored, backed up, etc. The SLA should be \u0026quot;Yes\u0026quot; only if the VM is Managed.\nThe inputs and thus the customization options are:\nName Image Flavour SLA Managed Network 1formatVersion: 1 2inputs: 3 Name: 4 type: string 5 title: Name 6 Image: 7 type: string 8 title: Image 9 oneOf: 10 - title: WIN-SRV-2019 11 const: WIN-2019-TEMPLATE 12 - title: WIN-SRV-2022 13 const: WIN-2022-TEMPLATE 14 default: WIN-2019-TEMPLATE 15 Flavour: 16 type: string 17 title: Flavour 18 oneOf: 19 - title: SMALL 20 const: SMALL 21 - title: MEDIUM 22 const: MEDIUM 23 - title: LARGE 24 const: LARGE 25 Managed: 26 type: string 27 titile: Manged 28 oneOf: 29 - title: \u0026#39;Yes\u0026#39; 30 const: \u0026#39;YES\u0026#39; 31 - title: \u0026#39;No\u0026#39; 32 const: \u0026#39;NO\u0026#39; 33 sla: 34 type: string 35 title: SLA 36 oneOf: 37 - title: H24 38 const: H24 39 - title: STD 40 const: STD 41 Network: 42 type: string 43 title: Network 44 oneOf: 45 - title: YOUR_NETWORK_NAME 46 const: network:YOUR_NETWORK_TAG 47resources: 48 Cloud_vSphere_Machine_1: 49 type: Cloud.vSphere.Machine 50 properties: 51 name: ${input.Name} 52 image: ${input.Image} 53 flavor: ${input.Flavour} 54 Managed: ${input.Managed} 55 sla: ${input.sla} 56 storage: 57 constraints: 58 - tag: Storage:YOUR_STORAGE_TAG 59 networks: 60 - network: ${resource.Cloud_vSphere_Network_1.id} 61 constraints: 62 - tag: Cluster:YOUR_CLUSTER_TAG 63 Cloud_vSphere_Network_1: 64 type: Cloud.vSphere.Network 65 properties: 66 networkType: existing 67 constraints: 68 - tag: ${input.Network} GCP Blueprint The GCP Blueprint includes Windows and Linux images. In this instance, as it's configured with only one Cloud Account, there's no need to specify details like the cluster. It's sufficient to add the tag associated with the Cloud Zone to the VM.\nThe inputs are:\nName Image Flavour SLA Managed 1 2formatVersion: 1 3inputs: 4 Name: 5 type: string 6 title: Name 7 Image: 8 type: string 9 title: System OS 10 description: Choose OS 11 oneOf: 12 - title: Windows Server 2022 13 const: GCP-IMG_Win202022 14 - title: Windows Server 2019 15 const: GCP-IMG_Win2019 16 - title: UBUNTU-2210 17 const: GCP-UBUNTU-2210 18 default: GCP-IMG_Win2019 19 Flavour: 20 type: string 21 title: Flavour 22 oneOf: 23 - title: SMALL 24 const: SMALL-GCP-n2-standard-2 25 - title: MEDIUM 26 const: MEDIUM-GCP-n2-standard-4 27 - title: LARGE 28 const: LARGE-GCP-n2-standard-8 29 Managed: 30 type: string 31 titile: Manged 32 oneOf: 33 - title: \u0026#39;Yes\u0026#39; 34 const: \u0026#39;YES\u0026#39; 35 - title: \u0026#39;No\u0026#39; 36 const: \u0026#39;NO\u0026#39; 37 sla: 38 type: string 39 title: SLA 40 oneOf: 41 - title: H24 42 const: H24 43 - title: STD 44 const: STD 45resources: 46 Cloud_GCP_Machine_1: 47 type: Cloud.GCP.Machine 48 properties: 49 name: ${input.Name} 50 image: ${input.Image} 51 flavor: ${input.Flavour} 52 Managed: ${input.Managed} 53 sla: ${input.sla} 54 networks: 55 - assignPublicIpAddress: false 56 constraints: 57 - tag: platform:gcp #match only one gcp cloud zone and associated network Azure Blueprint In this case too, I have mapped both Windows and Linux images, and the rest of the template is very similar to the previous ones.\nThe inputs are the same as for GCP:\nName Image Flavour SLA Managed 1formatVersion: 1 2inputs: 3 Name: 4 type: string 5 title: Name 6 Image: 7 type: string 8 title: System OS 9 description: Choose OS 10 oneOf: 11 - title: Windows Server 2019 12 const: Azure-WindowsServer:2019-Datacenter:lates 13 - title: UBUNTU-2204 14 const: AZURE-UBUNTU-2204 15 default: Azure-WindowsServer:2019-Datacenter:lates 16 Flavour: 17 type: string 18 title: Flavour 19 oneOf: 20 - title: SMALL 21 const: Azure-Standard_B2as_v2 22 - title: MEDIUM 23 const: Azure-Standard_B4als_v2 24 - title: LARGE 25 const: Azure-Standard_B8als_v2 26 Managed: 27 type: string 28 titile: Manged 29 oneOf: 30 - title: \u0026#39;Yes\u0026#39; 31 const: \u0026#39;YES\u0026#39; 32 - title: \u0026#39;No\u0026#39; 33 const: \u0026#39;NO\u0026#39; 34 sla: 35 type: string 36 title: SLA 37 oneOf: 38 - title: H24 39 const: H24 40 - title: STD 41 const: STD 42resources: 43 Cloud_Network_1: 44 type: Cloud.Network 45 properties: 46 networkType: existing 47 constraints: 48 - tag: Network:YOUR_AZURE_NETWORK_TAG 49 Cloud_Azure_Machine_1: 50 type: Cloud.Azure.Machine 51 properties: 52 image: ${input.Image} 53 flavor: ${input.Flavour} 54 Managed: ${input.Managed} 55 sla: ${input.sla} 56 constraints: 57 - tag: YOUR_AZURE_ZONE_TAG 58 networks: 59 - network: ${resource.Cloud_Network_1.id} 60 - assignPublicIpAddress: false Warning Warning: All the above examples are for demonstration purposes and must be adapted to your own configuration.\nCSV file The CSV file is quite straightforward, although it may not seem so at first glance. It contains a list of all the various possible combinations of VMs, their specifications, and prices.\nAs mentioned earlier, the fundamental values on which the price is calculated are:\nFlavour SLA CloudZone OS Managed / Unamanged 1Template;SLA;Flavour;OS;cloudzone;managed;vcpu;vram;vm price;managing price 2vCenter managed windows (H24);H24;small;windows;vCenter;yes;2;8;65,22;46,67 3vCenter managed windows (H24);H24;medium;windows;vCenter;yes;4;16;112,81;46,67 4vCenter managed windows (H24);H24;large;windows;vCenter;yes;8;32;207,98;46,67 5vCenter unmanaged windows;NULL;small;windows;vCenter;no;2;8;65,22;null 6vCenter unmanaged windows;NULL;medium;windows;vCenter;no;4;16;112,81;null 7vCenter unmanaged windows;NULL;large;windows;vCenter;no;8;32;207,98;null 8vCenter managed windows (STD);STD;small;windows;vCenter;yes;2;8;65,22;42,50 9vCenter managed windows (STD);STD;medium;windows;vCenter;yes;4;16;112,81;42,50 10vCenter managed windows (STD);STD;large;windows;vCenter;yes;8;32;207,98;42,50 11vCenter managed linux (H24);H24;small;linux;vCenter;yes;2;8;52,57;46,67 12vCenter managed linux (H24);H24;medium;linux;vCenter;yes;4;16;87,51;46,67 13vCenter managed linux (H24);H24;large;linux;vCenter;yes;8;32;157,38;46,67 14vCenter unmanaged linux;NULL;small;linux;vCenter;no;2;8;52,57;null 15vCenter unmanaged linux;NULL;medium;linux;vCenter;no;4;16;87,51;null 16vCenter unmanaged linux;NULL;large;linux;vCenter;no;8;32;157,38;null 17vCenter managed linux (STD);STD;small;linux;vCenter;yes;2;8;52,57;42,50 18vCenter managed linux (STD);STD;medium;linux;vCenter;yes;4;16;87,51;42,50 19vCenter managed linux (STD);STD;large;linux;vCenter;yes;8;32;157,38;42,50 20GCP managed windows (H24);H24;small;windows;GCP;yes;2;8;122,71;46,67 21GCP managed windows (H24);H24;medium;windows;GCP;yes;4;16;239,93;46,67 22GCP managed windows (H24);H24;large;windows;GCP;yes;8;32;474,37;46,67 23GCP unmanaged windows;NULL;small;windows;GCP;no;2;8;122,71;null 24GCP unmanaged windows;NULL;medium;windows;GCP;no;4;16;239,93;null 25GCP unmanaged windows;NULL;large;windows;GCP;no;8;32;474,37;null 26GCP managed windows (STD);STD;small;windows;GCP;yes;2;8;122,71;42,50 27GCP managed windows (STD);STD;medium;windows;GCP;yes;4;16;239,93;42,50 28GCP managed windows (STD);STD;large;windows;GCP;yes;8;32;474,37;42,50 29GCP managed linux (H24);H24;small;linux;GCP;yes;2;8;59,17;46,67 30GCP managed linux (H24);H24;medium;linux;GCP;yes;4;16;112,86;46,67 31GCP managed linux (H24);H24;large;linux;GCP;yes;8;32;220,22;46,67 32GCP unmanaged linux;NULL;small;linux;GCP;no;2;8;59,17;null 33GCP unmanaged linux;NULL;medium;linux;GCP;no;4;16;112,86;null 34GCP unmanaged linux;NULL;large;linux;GCP;no;8;32;220,22;null 35GCP managed linux (STD);STD;small;linux;GCP;yes;2;8;59,17;42,50 36GCP managed linux (STD);STD;medium;linux;GCP;yes;4;16;112,86;42,50 37GCP managed linux (STD);STD;large;linux;GCP;yes;8;32;220,22;42,50 38AZURE managed windows (H24);H24;small;windows;AZURE;yes;2;8;145,31;46,67 39AZURE managed windows (H24);H24;medium;windows;AZURE;yes;4;16;286,08;46,67 40AZURE managed windows (H24);H24;large;windows;AZURE;yes;8;32;567,62;46,67 41AZURE unmanaged windows;NULL;small;windows;AZURE;no;2;8;145,31;null 42AZURE unmanaged windows;NULL;medium;windows;AZURE;no;4;16;286,08;null 43AZURE unmanaged windows;NULL;large;windows;AZURE;no;8;32;567,62;null 44AZURE managed windows (STD);STD;small;windows;AZURE;yes;2;8;145,31;42,50 45AZURE managed windows (STD);STD;medium;windows;AZURE;yes;4;16;286,08;42,50 46AZURE managed windows (STD);STD;large;windows;AZURE;yes;8;32;567,62;42,50 47AZURE managed linux (H24);H24;small;linux;AZURE;yes;2;8;81,83;46,67 48AZURE managed linux (H24);H24;medium;linux;AZURE;yes;4;16;159,11;46,67 49AZURE managed linux (H24);H24;large;linux;AZURE;yes;8;32;313,68;46,67 50AZURE unmanaged linux;NULL;small;linux;AZURE;no;2;8;81,83;null 51AZURE unmanaged linux;NULL;medium;linux;AZURE;no;4;16;159,11;null 52AZURE unmanaged linux;NULL;large;linux;AZURE;no;8;32;313,68;null 53AZURE managed linux (STD);STD;small;linux;AZURE;yes;2;8;81,83;42,50 54AZURE managed linux (STD);STD;medium;linux;AZURE;yes;4;16;159,11;42,50 55AZURE managed linux (STD);STD;large;linux;AZURE;yes;8;32;313,68;42,50 Save this CSV file as prices.csv.\nWarning Please note, the prices listed are only examples and do not represent real prices!!\nvRo Action Script The PowerShell script, taking the previously specified data as input, matches it with the data inside the CSV file and then calculates the price, which is then returned as a value.\nIn this case, the price format uses a comma to separate decimal values. For example, €60,45 (60 euros and 45 cents).\n1function Handler($context, $inputs) { 2 3 function Get-CsvData { 4 param ( 5 [string]$searchBasePath, 6 [string]$fileName 7 ) 8 9 Write-Host \u0026#34;Searching for the file \u0026#39;$fileName\u0026#39; starting from the base path: $searchBasePath\u0026#34; 10 11 # Listing files in the search directory (for debugging) 12 Write-Host \u0026#34;List the files in the base path (for debugging)\u0026#34; 13 Get-ChildItem -Path $searchBasePath -Recurse -File -ErrorAction SilentlyContinue | Select-Object -First 10 | ForEach-Object { Write-Host $_.FullName } 14 15 # Search for the file in the specified path and its subdirectories 16 $fileFullPath = Get-ChildItem -Path $searchBasePath -Filter $fileName -Recurse -File | Select-Object -First 1 17 18 if ($fileFullPath -eq $null) { 19 Write-Host \u0026#34;File not found: $fileName\u0026#34; 20 return $null 21 } 22 23 Write-Host \u0026#34;File path not found: $($fileFullPath.FullName)\u0026#34; 24 25 # Import data from the found CSV file 26 $data = Import-Csv -Path $fileFullPath.FullName -Delimiter \u0026#39;;\u0026#39; 27 return $data 28 } 29 30 function get-Price { 31 param ( 32 [string]$sla, 33 [string]$Flavour, 34 [string]$osInput, 35 [string]$managed, 36 [string]$cloudzone, 37 [string]$filePath 38 ) 39 40 # Normalize the value of $Flavour 41 $FlavourNormalized = $null 42 switch -Regex ($Flavour) { 43 \u0026#34;SMALL\u0026#34; { $FlavourNormalized = \u0026#34;small\u0026#34; } 44 \u0026#34;MEDIUM\u0026#34; { $FlavourNormalized = \u0026#34;medium\u0026#34; } 45 \u0026#34;LARGE\u0026#34; { $FlavourNormalized = \u0026#34;large\u0026#34; } 46 } 47 48 # Normalize the value of $os based on the input for linux match lx and ubuntu for windows win and windows 49 $os = $null 50 if ($osInput -match \u0026#34;win|windows\u0026#34;) { 51 $os = \u0026#34;windows\u0026#34; 52 } elseif ($osInput -match \u0026#34;lx|ubuntu\u0026#34;) { 53 $os = \u0026#34;linux\u0026#34; 54 } 55 56 # Import data from the CSV file 57 $data = Get-CsvData -searchBasePath $filePath -fileName \u0026#34;prices.csv\u0026#34; 58 if ($data -eq $null) { 59 return \u0026#34;File not found\u0026#34; 60 } 61 62 # Data filtering 63 $filteredData = $data | Where-Object { 64 $_.SLA -eq $sla -and $_.Flavour -eq $FlavourNormalized -and 65 $_.OS -eq $os -and $_.managed -eq $managed -and 66 $_.cloudzone -eq $cloudzone 67 } | Select-Object -First 1 68 69 if ($filteredData) { 70 # Use CultureInfo to correctly interpret numbers with a comma 71 $culture = [System.Globalization.CultureInfo]::GetCultureInfo(\u0026#34;it-IT\u0026#34;) 72 73 # Handle null values for vm price and managing price 74 $priceVmStr = if ($filteredData.\u0026#34;vm price\u0026#34; -eq \u0026#34;null\u0026#34; -or $filteredData.\u0026#34;vm price\u0026#34; -eq $null) { \u0026#34;0\u0026#34; } else { $filteredData.\u0026#34;vm price\u0026#34; } 75 $priceGestioneStr = if ($filteredData.\u0026#34;managing price\u0026#34; -eq \u0026#34;null\u0026#34; -or $filteredData.\u0026#34;managing price\u0026#34; -eq $null) { \u0026#34;0\u0026#34; } else { $filteredData.\u0026#34;managing price\u0026#34; } 76 77 # Try to convert prices into decimal numbers 78 try { 79 $priceVm = [double]::Parse($priceVmStr, [System.Globalization.NumberStyles]::Any, $culture) 80 $priceGestione = [double]::Parse($priceGestioneStr, [System.Globalization.NumberStyles]::Any, $culture) 81 } catch { 82 Write-Host \u0026#34;Error in price conversion: $_\u0026#34; 83 return \u0026#34;Error in converting prices\u0026#34; 84 } 85 86 # Calculate the total cost 87 $priceTotal = \u0026#34;{0:N2}\u0026#34; -f ($priceVm + $priceGestione) 88 89 # Extract details from $filteredData 90 $vcpu = $filteredData.vcpu 91 $vram = $filteredData.vram 92 93 # Create the output string with details 94 $outputString = \u0026#34;• vCPU: $vcpu `n\u0026#34; + 95 \u0026#34;• vRAM: ${vram}GB `n\u0026#34; + 96 \u0026#34;• vDisk Standard Performance: 60 GB `n\u0026#34; + 97 \u0026#34;• OS: $os `n\u0026#34; + 98 \u0026#34;• SLA: $sla `n\u0026#34; + 99 \u0026#34;• vm price: €$priceTotal / month\u0026#34; 100 101 return $outputString 102 } 103 104 return \u0026#34;Can\u0026#39;t find prices\u0026#34; 105 } 106 107 # Retrieve inputs from the passed parameters 108 $sla = $inputs.sla 109 $Flavour = $inputs.Flavour 110 $os = $inputs.os 111 $managed = $inputs.managed 112 $cloudzone = $inputs.cloudzone 113 114 # Base path from which to start searching for the CSV file 115 $searchBasePath = \u0026#34;./\u0026#34; 116 117 # Calculate the price 118 $price = get-Price -sla $sla -Flavour $Flavour -osInput $os -managed $managed -cloudzone $cloudzone -filePath $searchBasePath 119 120 return $price 121} Now, let's create a zip file containing both the CSV file and the PowerShell script. The zipped file should be imported into the vRo action set with Type Zip:\nNote Note that the entry handler value should be entered as PS1__FILE__NAME.YOUR__HandlerFunction (In my case, pricefromfile.Handler).\nWarning Warning: The script mentioned above is for illustrative purposes and may need to be adapted to your own environment and needs.\nService Broker Using vRo Action in Service Broker Now we need to integrate our newly created Action in vRo into the Service Broker to display the output of our script that calculates prices.\nTo do this, after publishing the Blueprint inside the Service Broker, we create a Custom Form.\nAs the last block, we add a text element, changing the value from Constant to External and then selecting the name of the vRo Action we just created.\nIn this case, the CloudZone is entered as a Constant instead of a Field of the Blueprint. Before proceeding to save, we also need to insert a custom CSS, otherwise, the output text will be written all on the same line, whereas we want a more readable formatting.\nTo do this, click on Actions and then on Import CSS. The CSS code is really super simple:\n1cf-text { 2 white-space: pre; 3} Warning Warning: This CSS will modify all the text-type elements you have added. It might cause some issues if you have multiple text fields.\nAfter importing the CSS file, everything is ready! Click on 'Create', then 'Enable', and we can proceed with a test. After that, we'll need to do the same for the remaining Blueprints.\nNotes Output The script's output displays the following information: some details like vCPU and vRAM are calculated from the CSV file. Others, such as vDisk, are constants (this is because, for simplicity, the Blueprint templates have been customized to have the OS disk of the same size). This can also be modified if necessary.\n\u0026quot;• vCPU: $vcpu \u0026quot; \u0026quot;• vRAM: ${vram}GB \u0026quot; \u0026quot;• vDisk Standard Performance: 60 GB \u0026quot; \u0026quot;• OS: $os \u0026quot; \u0026quot;• SLA: $sla \u0026quot; \u0026quot;• vm price: €$priceTotal / month\u0026quot; ","link":"https://www.immiblogghenicloud.cloud/posts/aria-automation-prices-without-pricing-cards/","section":"posts","tags":["POWERSHELL","VMWARE","VRA","VRO","ARIA"],"title":"Aria Automation - Prices without Pricing Cards"},{"body":"","link":"https://www.immiblogghenicloud.cloud/tags/powershell/","section":"tags","tags":null,"title":"POWERSHELL"},{"body":"","link":"https://www.immiblogghenicloud.cloud/categories/microsoft/","section":"categories","tags":null,"title":"Microsoft"},{"body":"","link":"https://www.immiblogghenicloud.cloud/tags/sccm/","section":"tags","tags":null,"title":"SCCM"},{"body":"Intro These are various queries to populate the collections in SCCM, which will be updated in the future.\nAdditionally, at the bottom, I have included a script for the automatic addition of the collections shown in this post\nCollections Collection Boundary Groups Based This query adds the devices that are part of a specific Boundary Group to the collection. It's necessary to modify the query by inserting the name of your own group.\n1select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.ResourceId in (select resourceid from SMS_CollectionMemberClientBaselineStatus where SMS_CollectionMemberClientBaselineStatus.boundarygroups = \u0026#39;YOUR_BOUNDARY_GROUP_HERE\u0026#39;) and SMS_R_System.Name not in (\u0026#39;Unknown\u0026#39;) and SMS_R_System.Client = \u0026#39;1\u0026#39; Windows OS version Collections Collection Windows 10 20H2 Based This query adds devices with Windows 10 20H2 installed to the collection.\n1select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.Build = \u0026#39;10.0.19042\u0026#39; Collection Windows 10 21H1 Based This query adds devices with Windows 10 21H1 installed to the collection.\n1select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.Build = \u0026#39;10.0.19043\u0026#39; Collection Windows 10 21H2 Based This query adds devices with Windows 10 21H2 installed to the collection:\n1select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.Build = \u0026#39;10.0.19044\u0026#39; Collection Windows 10 22H2 Based This query adds devices with Windows 10 22H2 installed to the collection:\n1select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.Build = \u0026#39;10.0.19045\u0026#39; Collection Windows Server 2012 Based This query adds devices with Windows Server 2012 installed to the collection:\n1select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.OperatingSystemNameandVersion like \u0026#34;Microsoft Windows NT Server 6.2%\u0026#34; OR SMS_R_System.OperatingSystemNameandVersion like \u0026#34;Microsoft Windows NT Advanced Server 6.2%\u0026#34; Collection Windows Server 2012 R2 Based This query adds devices with Windows Server 2012 R2 installed to the collection:\n1select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.OperatingSystemNameandVersion like \u0026#34;Microsoft Windows NT Server 6.3%\u0026#34; OR SMS_R_System.OperatingSystemNameandVersion like \u0026#34;Microsoft Windows NT Advanced Server 6.3%\u0026#34; Collection Windows Server 2016 Standard Based This query adds devices with Windows Server 2016 Standard installed to the collection:\n1select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = \u0026#34;10.0.14393\u0026#34; and SMS_G_System_OPERATING_SYSTEM.Caption = \u0026#34;Microsoft Windows Server 2016 Standard\u0026#34; Collection Windows Server 2016 Datacenter Based This query adds devices with Windows Server 2016 Datacenter installed to the collection:\n1select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = \u0026#34;10.0.14393\u0026#34; and SMS_G_System_OPERATING_SYSTEM.Caption = \u0026#34;Microsoft Windows Server 2016 Datacenter\u0026#34; Collection Windows Server 2019 Standard Based This query adds devices with Windows Server 2019 Standard installed to the collection:\n1select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = \u0026#34;10.0.17763\u0026#34; and SMS_G_System_OPERATING_SYSTEM.Caption = \u0026#34;Microsoft Windows Server 2019 Standard\u0026#34; Collection Windows Server 2019 Datacenter Based This query adds devices with Windows Server 2019 Datacenter installed to the collection:\n1select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = \u0026#34;10.0.17763\u0026#34; and SMS_G_System_OPERATING_SYSTEM.Caption = \u0026#34;Microsoft Windows Server 2019 Datacenter\u0026#34; Collection Windows Server 2022 Standard Based This query adds devices with Windows Server 2022 Standard installed to the collection:\n1select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = \u0026#34;10.0.20348\u0026#34; and SMS_G_System_OPERATING_SYSTEM.Caption = \u0026#34;Microsoft Windows Server 2022 Standard\u0026#34; Collection Windows Server 2022 Datacenter Based This query adds devices with Windows Server 2022 Datacenter installed to the collection:\n1select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = \u0026#34;10.0.20348\u0026#34; and SMS_G_System_OPERATING_SYSTEM.Caption = \u0026#34;Microsoft Windows Server 2022 Datacenter\u0026#34; Script for Automatic Collection Creation I have created a small script for the automatic creation of collections that I use most frequently when working on a new SCCM server. This saves me a lot of time compared to manually creating each one.\nHere is the code for the script:\n1 2 # Definition of collections and their queries 3 4$collections = @( 5 @{ 6 Name = \u0026#34;Windows Server 2019 Standard Based\u0026#34; 7 Query = \u0026#34;select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = \u0026#39;10.0.17763\u0026#39; and SMS_G_System_OPERATING_SYSTEM.Caption = \u0026#39;Microsoft Windows Server 2019 Standard\u0026#39;\u0026#34; 8 }, 9 @{ 10 Name = \u0026#34;Windows Server 2019 Datacenter Based\u0026#34; 11 Query = \u0026#34;select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = \u0026#39;10.0.17763\u0026#39; and SMS_G_System_OPERATING_SYSTEM.Caption = \u0026#39;Microsoft Windows Server 2019 Datacenter\u0026#39;\u0026#34; 12 }, 13 @{ 14 Name = \u0026#34;Windows 10 20H2 Based\u0026#34; 15 Query = \u0026#34;select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.Build = \u0026#39;10.0.19042\u0026#39;\u0026#34; 16 }, 17 @{ 18 Name = \u0026#34;Windows 10 21H1 Based\u0026#34; 19 Query = \u0026#34;select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.Build = \u0026#39;10.0.19043\u0026#39;\u0026#34; 20 }, 21 @{ 22 Name = \u0026#34;Windows 10 21H2 Based\u0026#34; 23 Query = \u0026#34;select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.Build = \u0026#39;10.0.19044\u0026#39;\u0026#34; 24 }, 25 @{ 26 Name = \u0026#34;Windows 10 22H2 Based\u0026#34; 27 Query = \u0026#34;select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.Build = \u0026#39;10.0.19045\u0026#39;\u0026#34; 28 }, 29 @{ 30 Name = \u0026#34;Windows Server 2012 Based\u0026#34; 31 Query = \u0026#34;select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.OperatingSystemNameandVersion like \u0026#34;Microsoft Windows NT Server 6.2%\u0026#34; OR SMS_R_System.OperatingSystemNameandVersion like \u0026#34;Microsoft Windows NT Advanced Server 6.2%\u0026#34;\u0026#34; 32 }, 33 @{ 34 Name = \u0026#34;Windows Server 2012 R2 Based\u0026#34; 35 Query = \u0026#34;select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.OperatingSystemNameandVersion like \u0026#34;Microsoft Windows NT Server 6.3%\u0026#34; OR SMS_R_System.OperatingSystemNameandVersion like \u0026#34;Microsoft Windows NT Advanced Server 6.3%\u0026#34;\u0026#34; 36 }, 37 @{ 38 Name = \u0026#34;Windows Server 2016 Standard Based\u0026#34; 39 Query = \u0026#34;select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = \u0026#34;10.0.14393\u0026#34; and SMS_G_System_OPERATING_SYSTEM.Caption = \u0026#34;Microsoft Windows Server 2016 Standard\u0026#34;\u0026#34; 40 }, 41 @{ 42 Name = \u0026#34;Windows Server 2016 Datacenter Based\u0026#34; 43 Query = \u0026#34;select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = \u0026#34;10.0.14393\u0026#34; and SMS_G_System_OPERATING_SYSTEM.Caption = \u0026#34;Microsoft Windows Server 2016 Datacenter\u0026#34;\u0026#34; 44 }, 45 @{ 46 Name = \u0026#34;Windows Server 2019 Standard Based\u0026#34; 47 Query = \u0026#34;select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = \u0026#34;10.0.17763\u0026#34; and SMS_G_System_OPERATING_SYSTEM.Caption = \u0026#34;Microsoft Windows Server 2019 Standard\u0026#34;\u0026#34; 48 }, 49 @{ 50 Name = \u0026#34;Windows Server 2019 Datacenter Based\u0026#34; 51 Query = \u0026#34;select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = \u0026#34;10.0.17763\u0026#34; and SMS_G_System_OPERATING_SYSTEM.Caption = \u0026#34;Microsoft Windows Server 2019 Datacenter\u0026#34;\u0026#34; 52 }, 53 @{ 54 Name = \u0026#34;Windows Server 2022 Standard Based\u0026#34; 55 Query = \u0026#34;select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = \u0026#34;10.0.20348\u0026#34; and SMS_G_System_OPERATING_SYSTEM.Caption = \u0026#34;Microsoft Windows Server 2022 Standard\u0026#34;\u0026#34; 56 }, 57 @{ 58 Name = \u0026#34;Windows Server 2022 Datacenter Based\u0026#34; 59 Query = \u0026#34;select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.Version = \u0026#34;10.0.20348\u0026#34; and SMS_G_System_OPERATING_SYSTEM.Caption = \u0026#34;Microsoft Windows Server 2022 Datacenter\u0026#34;\u0026#34; 60 } 61 62) 63 64# Creation of collections 65foreach ($collection in $collections) { 66 $collectionName = $collection.Name 67 $collectionQuery = $collection.Query 68 69 # Create the collection 70 $newCollection = New-CMDeviceCollection -Name $collectionName -LimitingCollection \u0026#34;All Systems\u0026#34; 71 72 # Add the query rule 73 Add-CMDeviceCollectionQueryMembershipRule -CollectionId $newCollection.CollectionID -QueryExpression $collectionQuery -RuleName \u0026#34;$collectionName Rule\u0026#34; 74 75 Write-Host \u0026#34;Collection created: $collectionName\u0026#34; 76} ","link":"https://www.immiblogghenicloud.cloud/posts/sccm-collections/","section":"posts","tags":["POWERSHELL","SCCM"],"title":"SCCM collections"},{"body":"VMware Aria related links https://garyflynn.com/tags/vra/ https://vmwarecode.com/ https://blog.stijnvermoesen.be/ https://samperrin.com/ https://automateclouds.com/ https://www.brockpeterson.com/ https://blog.stijnvermoesen.be/ https://rudimartinsen.com/ https://cloudblogger.co.in/ https://kuklis.github.io/cma/ https://adrian.heissler.at/blog/ https://www.vvork.info/ https://vninja.net/ https://docs.vmware.com/en/vRealize-Automation/8.11/Using-and-Managing-Service-Broker/GUID-953BBA14-530D-4606-8A34-BEA4FB552AA5.html#GUID-953BBA14-530D-4606-8A34-BEA4FB552AA5 many...\n","link":"https://www.immiblogghenicloud.cloud/useful-links/","section":"","tags":null,"title":"Useful Links"},{"body":"Remote Desktop Manager is a fantastic tool for centralized management of various accesses to VMs and services. I have personally always used RDM to save the RDP and SSH connections that I most frequently used.\nThis tool, when used in conjunction with Devolutions Server (DVLS), is excellent for teams that need a centralized and common repository for access.\nRecently, I found myself in need of automating the creation of entries within the various Vaults inside DVLS to reduce the effort caused by adding them manually.\nIn this post, I will show how to create a Workflow within VRO and a subscription in VRA to automate the addition of the entry following the deployment of a VM in VRA. The type of connection in this case will be a CyberarkPSM Connection. As this is a simplified example, we will statically define the Vault in which the entry will be created.\nRDM Preparation First of all, it is necessary to create an APP Account that is part of a local admin group and that has access to the Vault where you want to create the Entry.\nTo simplify the creation with all the necessary data, we create a shared Template with the information required for the connection, such as Privileged Account, PSM Server, and Connection Component. Let's take note of the name of the RDM Vault in which we want to create the connection, as we will need it later.\nCreation of the Workflow Environment First of all, it is necessary to create the Environment that includes the RDM PowerShell module.\nThe name of the module is Devolutions.Powershell, and the version in this case is 2023.2.0.9 Note Be aware of the version compatibility between the module and the DVLS server. If you are using a server version 2023.2.XX as in this example, you will need to use the ps module version 2023.2.XX; otherwise, the script will connect in Read-Only mode. It's important to have the server and ps module versions aligned.\nWorflow The workflow consists of two Scriptable tasks. The first, \u0026quot;Get Properties\u0026quot;, retrieves the VM name and IP address from the deployment by reading the InputProperties. The second, \u0026quot;AddSessionToRDMVault\u0026quot;, connects to the server and creates the entry using the data retrieved from the first script.\nAs Variables and Input/Output, we have: The JavaScript code for the Get Properties task, which has \u0026quot;inputProperties\u0026quot; as input and \u0026quot;VMresourceName\u0026quot; and \u0026quot;vmIpAddress\u0026quot; as output, is very simple:\n1var resourceName = inputProperties.get(\u0026#34;resourceNames\u0026#34;); 2var resourceIp = inputProperties.get(\u0026#39;addresses\u0026#39;)[0][0]; 3 4System.log(\u0026#34;VM Name: \u0026#34; + resourceName[0]); 5System.log(\u0026#34;VM IP: \u0026#34; + resourceIp); 6 7VMresourceName = resourceName[0]; 8vmIpAddress = resourceIp; This is the PowerShell code for the \u0026quot;AddSessionToRDMVault\u0026quot; task, which has \u0026quot;VMresourceName\u0026quot; and \u0026quot;vmIpAddress\u0026quot; as inputs.\n1function Handler($context, $inputs) { 2 3 #setup connection to dvls 4 $dsname = \u0026#34;YOUR_DVLS_SERVER_CONNECTION_NAME_HERE\u0026#34; 5 $dsurl = \u0026#34;YOUR_DVLS_SERVER_URL_HERE\u0026#34; 6 $appkey = \u0026#34;eYOUR_APP_KEY_HERE\u0026#34; 7 $appsecret = \u0026#34;YOUR_APP_SECRET_HERE\u0026#34; 8 New-RDMDataSource -DVLS -Name $dsname -Server $dsurl -ScriptingTenantID $appkey -ScriptingApplicationPassword $appsecret -SetDatasource 9 $ds = Get-RDMDataSource -Name $dsname 10 Set-RDMDatasourceProperty -DataSource $ds -Property \u0026#34;Timeout\u0026#34; -Value 60 11 Set-RDMCurrentDataSource $ds.id 12 13 #get and set vault id 14 $repo = Get-RDMRepository -Name \u0026#34;YOUR_VAULT_NAME_HERE\u0026#34; 15 $repoid = $repo.id 16 Set-RDMCurrentRepository -id $repoid 17 18 #set session input details 19 $template = Get-RDMTemplate | Where-Object -FilterScript {$_.Name -eq \u0026#34;YOUR_TEMPLATE_NAME_HERE\u0026#34;} 20 $namesess = $inputs.VMresourceName 21 $hostip = $inputs.vmIpAddress 22 23 #create Session Entry 24 $session = New-RDMSession -Name $namesess -Host $hostip -Type \u0026#34;CyberArkPSM\u0026#34; -TemplateID $template.id -SetSession 25 Set-RDMSession -Session $session -Refresh 26 Update-RDMUI 27 28 #disconnect from DVLS 29 Get-RDMDataSource | Remove-RDMDataSource 30 31 return $output 32 33} Our Workflow looks like this: Extensibility Subscription To automatically execute the workflow with every VM deployment, we need to create a Subscription within the Extensibility menu of the Cloud Assembly as follows: The event topic should be \u0026quot;Compute post provision\u0026quot; so that our workflow is initiated only after the allocation of resources is complete. In this way, all the data necessary for its execution will be available. With these settings, the Subscription will be active for any deployment of any project within the organization.It is possible to filter it by event topic or by project. See Create an extensibility subscription\nConclusions When a new VM deployment is executed, this output is obtained: In the log, many warnings of \u0026quot;The operation has timed out.\u0026quot; are visible. To solve this problem, on the suggestion of Devolutions support, I added the following line to the script:\n1Set-RDMDatasourceProperty -DataSource $ds -Property \u0026#34;Timeout\u0026#34; -Value 60 However, this did not resolve the issue with the warnings. Nonetheless, despite the warnings, the script works correctly, and we find our entry within RDM. Unfortunately, I couldn't find useful documentation regarding the Devolutions PowerShell module, and since I don't have much time and it works, for now, I'm simply ignoring the warning.\nThe steps described in this post are simplified and may require further customization.\n","link":"https://www.immiblogghenicloud.cloud/posts/add-a-connection-entry-to-rdm-vault-on-new-vm-deployment/","section":"posts","tags":["POWERSHELL","VMWARE","RDM","VRA","VRO","ARIA"],"title":"Add a connection entry to RDM Vault on new vm deployment"},{"body":"","link":"https://www.immiblogghenicloud.cloud/tags/rdm/","section":"tags","tags":null,"title":"RDM"},{"body":"Hello and welcome to I MI' BLOGGHE NI' CLOUD!\nI'm Federico, an enthusiastic IT professional specializing in Cloud System Engineering with over eight years of experience in the Multicloud environment. Since my early days in this field, I've had the opportunity to work in both private and hybrid cloud environments, both within data centers and beyond. This diverse experience has given me a comprehensive understanding of the IT landscape.\nOver the years, I've primarily specialized in VMware and Microsoft technologies, honing my skills in virtualization and automation. However, my curiosity is always expanding, driving me to constantly seek out new challenges and opportunities in the technology field.\nThis blog stems from my desire to share the experiences and knowledge I've accumulated throughout my career with the online community. I've always found inspiration in those who generously share their experiences online, and now I want to actively contribute to this community by offering my insights and reflections. I hope my contributions can be helpful and informative to anyone seeking information and inspiration in the vast world of IT.\n","link":"https://www.immiblogghenicloud.cloud/about/","section":"","tags":null,"title":"About"},{"body":"","link":"https://www.immiblogghenicloud.cloud/series/","section":"series","tags":null,"title":"Series"}]