I have a problem. I need to change configuration parameters of VM in accordance with the hardening guide.
How I did it: I power off the VM then change parameters and then power it on - and everything works.
I have a really critical for bussiness VMs and I cant power them off. How can I change these parameters ?
I was trying to change the vmx file on running machine, but there is no result.
Please help! Thanks!
I'm sorry to say you cannot (and you should not)
VMware KB: Tips for editing a .vmx file
So you really need to organise an outage. You could minimise the outage by having a powercli script to
1. Shut down the guest gracefully
2. Edit the settings (or edit/replace the vmx file)
3. Restart the VM
Can you send me a manual how to use the powercli? I have never used it before.
The documentation is here.
vSphere PowerCLI Documentation
You would need to download and install powercli onto a server or client machine that can connect to your vCenter
A very rough guide (as I don't know your environment or what values in the vm config you are changing)
And you should be done.
Obviously you have to swap the bits in capitals with the servername or IP of your vcenter for #3 and the name of the VM in vcenter for #4, #5 and #6
It is possible to put this into a single .ps1 file and run it as a script but if you're new to powershell it's good to step through the actions so you can see the output.
Hope that helps.
Actually I remembered that you mentioned in your title you are doing vm hardening.
There is a blog post on how to automate (using powercli) the addition of advanced options to VMs
I would download and install powercli first. Get used to running a command or two. Then move on to following this blog post on how to create an option file which contains the settings you wish to add/change on lots of VMs
Automate the Hardening of Your Virtual Machine VMX Configurations | VMware vSphere Blog - VMware Blo...
I think that is exactly what you're looking for 😉
thanks! I will try it!
oh. PowerCLI can work only on Windows platform. but my vCenter on SUSE.
What can I do ?
However, You can install the powercli on other windows machines in your environment and connect to the vCenter using the standard cmdlets. Its not mandate that you have to run powercli on vCenter only.
You only need to install powercli on a computer that can connect to your vcenter.
Wherever you run vsphere client/web client from now will be the perfect place to install powercli