VMware Cloud Community
jared1
Contributor
Contributor
Jump to solution

How do I script networking, memory changes to multiple VMs?

I need to change multiple VMs to a different port group and adjust their memory settings. How can I accomplish this with a script?

Port Group 1 = VM1 / VM2 / VM3 / VM4 > Port Group 2

VM1 = 4096 > 2048

VM2 = 8192 > 2048

VM3 = 3072 > 1024

VM4 = 2048 > 1024

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
RParker
Immortal
Immortal
Jump to solution

Those are command line options. Each one would have to run in a script. ESX 3.5 uses perl. If you work for a fairly large organization, someone may be able to help you with a perl script. Perl is very common.

A developer or linux guru can help you. Those commands for vmware-cmd are run per VM, that's not a script. You can make a script to do it, but it would take a bit of work. It's easier to use the VI client and make the changes, even if it is tedious.

View solution in original post

0 Kudos
6 Replies
SRuff
Enthusiast
Enthusiast
Jump to solution

vmware-cmd </vmfs/volumes/dg_01/virtual_machine.vmx> setconfig memsize 2048

vmware-cmd </vmfs/volumes/dg_01/virtual_machine.vmx> setconfig ethernet0.networkName "Port Group 2"

jared1
Contributor
Contributor
Jump to solution

What type of file/script to process those commands like a batch file? Is there anything that needs to be done to run the script, such as making it executable? I only know how to create DOS batch files.

This is a ESX 3.5, btw.

Thanks!

0 Kudos
RParker
Immortal
Immortal
Jump to solution

Those are command line options. Each one would have to run in a script. ESX 3.5 uses perl. If you work for a fairly large organization, someone may be able to help you with a perl script. Perl is very common.

A developer or linux guru can help you. Those commands for vmware-cmd are run per VM, that's not a script. You can make a script to do it, but it would take a bit of work. It's easier to use the VI client and make the changes, even if it is tedious.

0 Kudos
jared1
Contributor
Contributor
Jump to solution

When I attempt to run the command:

vmware-cmd </vmfs/volumes/VM_volume/VM/VM.vmx> setconfig memsize 1024

I get:

Error executing the command "1024"

Thoughts?

0 Kudos
SRuff
Enthusiast
Enthusiast
Jump to solution

Try putting 1024 in double quotes "1024"

0 Kudos
jared1
Contributor
Contributor
Jump to solution

I have tried that with the same results.

0 Kudos