Greetings all,
We are using knife vsphere to automate the birthing of over a hundred VMs,
and it’s working well. One issue we can’t figure out though is how to set
the VM memory reservation during execution of the "knife vsphere vm clone"
command.
I see there is the --cspec CUST_SPEC option, but I cannot find anything
that explains what the format / syntax should be. Can anyone please point
me to where I can find that?
Greetings all,
We are using knife vsphere to automate the birthing of over a hundred VMs,
and it's working well. One issue we can't figure out though is how to set
the VM memory reservation during execution of the "knife vsphere vm clone"
command.
I see there is the --cspec CUST_SPEC option, but I cannot find anything
that explains what the format / syntax should be. Can anyone please point
me to where I can find that?
By memory reservation, do you mean the amount of virtual RAM allotted to a
VM OR memory reservation as used in resource management and allocation,
i.e reservation, shares etc.? The former can be specified using the
'--cram' option as mentioned by Johnny. The latter cannot be specified
using knife-vsphere. Setting memory reservation would be done via a
ResourceAllocationInfo managed data object as a part of the
VirtualMachineConfigSpec and I don't think knife-vsphere caters to this as
of now.
But yes before being able to specify RAM via cram (or CPU via ccpu for
that matter), you do need to specify --cspec. To do that, in Vcenter,
just create a customization specification (it's really basic info like
timezone, dns, etc):
Greetings all,
We are using knife vsphere to automate the birthing of over a hundred
VMs, and it's working well. One issue we can't figure out though is how to
set the VM memory reservation during execution of the "knife vsphere vm
clone" command.
I see there is the --cspec CUST_SPEC option, but I cannot find anything
that explains what the format / syntax should be. Can anyone please point
me to where I can find that?
Thank you Aditya, I was indeed referring to the memery reservation setting,
not the memory allocation which --cram is used for.
I'll look into ResourceAllocationInfo to see what I can find out about it.
Even if I cannot set it using knife vsphere, do you know of any other way I
can adjust that setting programmatically from a Linux host?
By memory reservation, do you mean the amount of virtual RAM allotted to a
VM OR memory reservation as used in resource management and allocation,
i.e reservation, shares etc.? The former can be specified using the
'--cram' option as mentioned by Johnny. The latter cannot be specified
using knife-vsphere. Setting memory reservation would be done via a
ResourceAllocationInfo managed data object as a part of the
VirtualMachineConfigSpec and I don't think knife-vsphere caters to this as
of now.
But yes before being able to specify RAM via cram (or CPU via ccpu
for that matter), you do need to specify --cspec. To do that, in Vcenter,
just create a customization specification (it's really basic info like
timezone, dns, etc):
Greetings all,
We are using knife vsphere to automate the birthing of over a hundred
VMs, and it's working well. One issue we can't figure out though is how to
set the VM memory reservation during execution of the "knife vsphere vm
clone" command.
I see there is the --cspec CUST_SPEC option, but I cannot find anything
that explains what the format / syntax should be. Can anyone please point
me to where I can find that?
Hi Johnny,
Actually I set ram, CPUs, etc without creating a custom spec in vcenter, it
works just fine without it. I was referring to memory reservation, not
allocation.
But I'll take a look at the docs you pointed to and see if THAT allows me
to set the reservation!
But yes before being able to specify RAM via cram (or CPU via ccpu for
that matter), you do need to specify --cspec. To do that, in Vcenter,
just create a customization specification (it's really basic info like
timezone, dns, etc):
Greetings all,
We are using knife vsphere to automate the birthing of over a hundred
VMs, and it's working well. One issue we can't figure out though is how to
set the VM memory reservation during execution of the "knife vsphere vm
clone" command.
I see there is the --cspec CUST_SPEC option, but I cannot find anything
that explains what the format / syntax should be. Can anyone please point
me to where I can find that?
Try the code given below to set the memory reservation. You will need the
RbVmomi gem for this. It searches for a VM called 'test_vm' in a folder
called 'vm_folder' and sets the memory reservation to 1024 MB.
#change_memory_reservation.rb
require 'rbvmomi'
vim = RbVmomi::VIM.connect host: '10.10.10.1', user: 'me', password:
'complex_password', insecure: true
vm = vim.serviceInstance.find_datacenter.find_vm("vm_folder/test_vm") or
abort("VM not found")
vm_config_spec = RbVmomi::VIM.VirtualMachineConfigSpec
vm_config_spec.memoryAllocation = RbVmomi::VIM.ResourceAllocationInfo
reservation: 1024
task = vm.ReconfigVM_Task spec: vm_config_spec
task.wait_for_completion
Hi Johnny,
Actually I set ram, CPUs, etc without creating a custom spec in vcenter,
it works just fine without it. I was referring to memory reservation, not
allocation.
But I'll take a look at the docs you pointed to and see if THAT allows me
to set the reservation!
But yes before being able to specify RAM via cram (or CPU via ccpu
for that matter), you do need to specify --cspec. To do that, in Vcenter,
just create a customization specification (it's really basic info like
timezone, dns, etc):
Greetings all,
We are using knife vsphere to automate the birthing of over a hundred
VMs, and it's working well. One issue we can't figure out though is how to
set the VM memory reservation during execution of the "knife vsphere vm
clone" command.
I see there is the --cspec CUST_SPEC option, but I cannot find anything
that explains what the format / syntax should be. Can anyone please point
me to where I can find that?
Try the code given below to set the memory reservation. You will need the
RbVmomi gem for this. It searches for a VM called 'test_vm' in a folder
called 'vm_folder' and sets the memory reservation to 1024 MB.
#change_memory_reservation.rb
require 'rbvmomi'
vim = RbVmomi::VIM.connect host: '10.10.10.1', user: 'me', password:
'complex_password', insecure: true
vm = vim.serviceInstance.find_datacenter.find_vm("vm_folder/test_vm") or
abort("VM not found")
vm_config_spec = RbVmomi::VIM.VirtualMachineConfigSpec
vm_config_spec.memoryAllocation = RbVmomi::VIM.ResourceAllocationInfo
reservation: 1024
task = vm.ReconfigVM_Task spec: vm_config_spec
task.wait_for_completion
Hi Johnny,
Actually I set ram, CPUs, etc without creating a custom spec in vcenter,
it works just fine without it. I was referring to memory reservation, not
allocation.
But I'll take a look at the docs you pointed to and see if THAT allows me
to set the reservation!
But yes before being able to specify RAM via cram (or CPU via ccpu
for that matter), you do need to specify --cspec. To do that, in Vcenter,
just create a customization specification (it's really basic info like
timezone, dns, etc):
Greetings all,
We are using knife vsphere to automate the birthing of over a hundred
VMs, and it's working well. One issue we can't figure out though is how to
set the VM memory reservation during execution of the "knife vsphere vm
clone" command.
I see there is the --cspec CUST_SPEC option, but I cannot find anything
that explains what the format / syntax should be. Can anyone please point
me to where I can find that?