def get_vm_resize_spec(client_factory, vcpus, memory_mb, extra_specs, metadata=None):
 resize_spec = client_factory.create('ns0:VirtualMachineConfigSpec')
 resize_spec.numCPUs = vcpus
 resize_spec.memoryMB = memory_mb
 resize_spec.cpuAllocation = _get_allocation_info(client_factory, extra_specs.cpu_limits, 'ns0:ResourceAllocationInfo')
 if metadata:
  resize_spec.annotation = metadata
 return resize_spec

def get_vm_resize_spec ( client_factory , vcpus , memory_mb , extra_specs , metadata = None ) : resize_spec = client_factory . create ( 'ns0:VirtualMachineConfigSpec' ) resize_spec . numCPUs = vcpus resize_spec . memoryMB = memory_mb resize_spec . cpuAllocation = _get_allocation_info ( client_factory , extra_specs . cpu_limits , 'ns0:ResourceAllocationInfo' ) if metadata : resize_spec . annotation = metadata return resize_spec
provides updates for a vm spec .