VMware {code} Community
ubekhet
Contributor
Contributor

Change memory dinamically

Hi,

I am wondering, if there is some possibility to change the amount of memory that one VM has, without to have power off, reconfig and power on. With change the amount of memory, I mean to change the limit of that.

Thank in advance!!!

Reply
0 Kudos
5 Replies
admin
Immortal
Immortal

You can change the memory allocation list of the vm, by creating a resourceconfigspec :

my $resourceAllocationMwm = ResourceAllocationInfo->new(limit=>$limit_mem);

Now, this resourceconfigspec can either be used to reconfigure a vm, which seems like you would not like to use:

my $vmConfig =

VirtualMachineConfigSpec->new (memoryAllocation => $resourceAllocationMem);

Util::trace(0,"Updating memory limit...");

$_->ReconfigVM (spec => $vmConfig);

The other method would be to use method, updateChildResouceConfiguration:

This method takes a reference to the resource pool and the resourceConfigSpec as parameters. You can create a resouceConfigSpec with the updated limit for memory allocation.

Reply
0 Kudos
ubekhet
Contributor
Contributor

Hi,

My unique target is be avaliable change the amount of memory of my VM when is running, without to stop it and the reconfig and finally start again. If you method gave me can do that I am glad to do what you said.

So, the both methods that you gave can do what I said? or only the last one?

Thanks?

Reply
0 Kudos
admin
Immortal
Immortal

If I understand your question correctly, you should be able to reconfig the vm even if it is running or powered on.

Reply
0 Kudos
daniel_uk
Hot Shot
Hot Shot

but is the VM able to access memory straight away or does it require a reboot?

Reply
0 Kudos
jrackliffe
Hot Shot
Hot Shot

You will need to reboot the machine from my experience.

Reply
0 Kudos