Hi All,
While pulling the RV tools report it pulls the information from Windows 2012 R2 as 2012 R though the VM is running with OS version 2016. In order to fix this each VM we need to change the option from VM edit setting --> VM option to OS 2016 but to apply the changes we need to unregister the VM's from inventory and add back to inventory which requires downtime.
We have around 800 VM's as windows 2016 but rvtools shows Windows 2012 R2 based on VC summary tab. We want to fix this from power cli. Screenshot attached.
It seems earlier VC 5.5 was not having for OS 2016 deployment. Any help will be much appreciated.
thanks
vmk
The value you see is the value you spcify when the VM is created.
There is in fact no obligation to actually install that guest OS on the VM.
Do you have VMware Tools installed on those VM?
If yes, you can obtain the guest OS version as obtained by the VMware Tools.
That value reflects the actual guest OS version.
The folowing snippet shows both values.
Select Name,
@{N='OSConfig';E={$_.ExtensionData.Config.GuestFullName}},
@{N='OS';E={$_.Guest.OSFullName}}
Do you in fact want to change the content of the CSV file created by RvTools?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
First of all, I would like to say thank you for responding to my query.
Do you have VMware Tools installed on those VM? -Yes.
Its appears that VC 5.5 was not having an option for 2016 OS while creating the VM's and whenever pull the report for OS, 2016 OS always shows as Windows 2012 R2 and even in summary tab.
This makes our calculation wrong. Even in the Summary tab of Guest os shows 2012 R2 through the OS installed is Windows 2016. I'm looking to fix through power cli if possible instead of visiting each VM's and changing the VMX file through the edit setting and then adding back to inventory which fixes the issues. It seems to remove and add back the VM to inventory updates VCSA DB as per my understanding..
thanks
vmk
I'm not sure I'm understanding what you are trying to do with unregistering/registering the VM.
Doing that alone will not update the GuestId you specified when you created the VM.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
Once, I change the VM guest OS from VMotion option from edit setting then the changes don't take place until I remove the VM's from inventory and add back from data store i.e. vmx file.
After following all these steps then it will reflect the correct OS in VC summary tab for Gues OS. Hope I am able to explain to you. Let me know if you have any questions.
Thanks
vmk
Not sure I'm following.
Where do you change the GuestId during a vMotion?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ok, I'm not doing any vmotion. I'm just editing the VM properties and then go to VM option, you will see Guest OS and Guest OS version then we can the Guest OS version as per requirement.
Here i changed to Windows 2016 but after adding back to inventory, it started showing correct OS version in VC summary tab of the VM's.
Let me know if you were able to understand. We need to fix around 800 VM's
No, not really.
The option you are describing is disabled (grayed out) when the VM is powered on.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You are right, we need to power off the VM first. Sorry about that
But then you don't need this unregister/register at all.
You could just do (for a powered off VM)
where{$_.GuestId -eq 'windows8Server64Guest'} |
Set-VM -GuestId 'windows9Server64Guest' -Confirm:$false
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
Can we do this for bulk VM's from text file C: \temp\vmlist.txt? I understand that we need to power off the VM's first to fix this issue.
Thanks
vmk
Yes, the VM needs to be powered off for this to work.
To read the VM names from a .txt file, and to stop the VMs, and wait till they are stopped, and then start the VMs again, is similar to what was done for changing the HW version of the VMs.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
Yes, we have around 800 VM's showing the wrong OS in the summary tab of VC, hence want to change in bulk.
Thanks
vmk
Yes, but didn't we do that same exercise for upgrading the VM's HW version?
Are we going to repeat that complete exercise here, or can you reuse that logic?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
sorry for the confusion. I'm not asking for VM HW version upgrade but Guest OS version upgrade in the summary tab of the VM.
thanks
vmk
I know, but what I'm trying to explain is that the complete flow resembles the one we did some time ago for upgrading the HW version.
Reading the VMs from a .txt file, stopping the VMs, making the change, starting the VMs..
My question is, can't you reuse that logic, and instead of doing the HW version upgrade, do the GuestId change.
And not go through all these same steps here again.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Sounds good. yes, I will use the same logic here.
Get-VM |
where{$_.GuestId -eq 'windows8Server64Guest'} |
Set-VM -GuestId 'windows9Server64Guest' -Confirm:$false
foreach($vmName in (Get-Content -Path C:\TEMP\vmliste.txt)){
$vm = Get-VM -Name $vmName
$vm.ExtensionData.ReconfigVM_Task($do)
}
For future reference, I'm referring to Re: Scheduling the Bulk VM's Hardware version upgrade in ESXi host 6.5 through power cli
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I think you might be mixing some snippets here.
The nucleus of the script should probably be
where{$_.GuestId -eq 'windows8Server64Guest'} |
Set-VM -GuestId 'windows9Server64Guest' -Confirm:$false
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you, LucD. I lost the links. Will test the script on Test VM's first and will update.
thanks
vmk