VMware {code} Community
VBDINO
Contributor
Contributor

script to change drs mode to manual and to automatic

I was wondering if among the programmers in this forum, if there is someone that could freely share a command line program that could set the DRS to manual or to automatic or even to semi-automatic.

Thanks

Reply
0 Kudos
10 Replies
hrobinson
VMware Employee
VMware Employee

Here is a VI Perl Script to configure DRS.

Please provide feedback (either positive or negative) if you find it useful. Note that we are planning a DRS workshop in the next few weeks to explain how many common tasks can be scripted.

Usage:

drsConfig.pl

list or edit DRS settings for a cluster

--server ] Automation level

\[--enable] Enable DRS

\[--disable] Disable DRS

Reply
0 Kudos
VBDINO
Contributor
Contributor

Thanks, I will surely try it next tuesday, when I get back to work.

Thanks again

Reply
0 Kudos
VBDINO
Contributor
Contributor

I was hoping to be able to run it, but I since I have no knowledge of perl, I failed.

If it is not to much troubles for you, can you tell me what I need to install and configure on my virtual center server, in order to use it.

Thanks.

Reply
0 Kudos
hrobinson
VMware Employee
VMware Employee

Using perl has nothing to do with the configuring the Virtual Center server. The good news is that we will be releasing a beta version of the VI Perl Toolkit in the next few weeks which should make it easier to you to install and run the supplied sample app.

I would suggest that you install that beta when available.

H

Reply
0 Kudos
VBDINO
Contributor
Contributor

Hi, could you post a new version that includes the vmotionrate setting. After using the current script for a while, I realized that it is best to set the level to 5 rather than disabling DRS. So if that is possible to make such modification, I would appreciate.

Thanks

Richard

Reply
0 Kudos
hrobinson
VMware Employee
VMware Employee

Here you go.

Please tell me if it meets your requirement.

Rate is set with the --rate <number>

Reply
0 Kudos
VBDINO
Contributor
Contributor

Thanks, exactly what I want! :smileyblush:

Richard.

Reply
0 Kudos
yaconsult
Contributor
Contributor

This script was just what I needed as we wanted to disable DRS during non-business hours.

It worked great at disabling and enabling DRS... except that all of the resource pools were deleted! I had to go back and recreate them and then move the VMs back into the appropriate pools. Smiley Sad

Any idea why this would happen? I need to be able to change DRS mode from my script without losing the resouce pools.

Reply
0 Kudos
bclow
Enthusiast
Enthusiast

Non-DRS clusters may not have resource pools - by disabling DRS, you're removing all resource pools from the cluster.

What are you trying to do?

Reply
0 Kudos
yaconsult
Contributor
Contributor

I inherited this environment and resource pools seem to be used only to group VMs together by project. Having all of the VMs at the top level, without pools makes it too hard to find things. Currently, the pool resource settings are all left at the default.

If I go to the cluster level in VirtualCenter, and then Edit Settings, I can go to VMware DRS and change the Automation Level between Manual and Fully Automated. When I do this, the Resource Pools are not affected.

When I do the same thing using the script here, the resource pools are deleted so all the VMs are at the same "level". I expected the script to have the same effect as making the change in the gui.

I could do a diagram if the above explanation is not clear.

Reply
0 Kudos