'Resizes the VM according to the flavor.'

def _resize_vm(self, context, instance, vm_ref, flavor, image_meta):

    client_factory = self._session.vim.client.factory
    extra_specs = self._get_extra_specs(flavor, image_meta)
    metadata = self._get_instance_metadata(context, instance)
    vm_resize_spec = vm_util.get_vm_resize_spec(client_factory, int(flavor.vcpus), int(flavor.memory_mb), extra_specs, metadata=metadata)
    vm_util.reconfigure_vm(self._session, vm_ref, vm_resize_spec)
