I have some HVM guests on XEN but most of them have memory around or less than 2048 MB. However when I tried to give more than 3200 MB of RAM to them I faced the following message:
# xl create /etc/xen/configs/a.conf
Parsing config from /etc/xen/configs/a.conf
xc: error: panic: xc_dom_boot.c:395: xc_dom_gnttab_hvm_seed: failed to add gnttab to physmap [errno=22]
: Internal error
libxl: error: libxl_dm.c:1388:device_model_spawn_outcome: domain 13 device model: spawn failed (rc=-3)
libxl: error: libxl_create.c:1186:domcreate_devmodel_started: device model did not start: -3
libxl: error: libxl_dm.c:1492:kill_device_model: Device Model already exited
And to make it easier, not all the tried XEN hosts produced the above message (6 in 7 produced).
After a lot of google searches (some with no results at all) I could not get around this problem, and after some trial and error guesses I found the problematic part.
It seems that the default shadow_memory = 8 (in MB) parameter was too low. After finding this out I found a post on the Xen-devel maillist mentioning the approximate requirements of the shadow_memory: there should be 2KB of memory for every one MB of RAM assigned to the guest domain, plus a few MB per vcpu (~2MB).
Anyway, doubling this number seems to be solving this problem, my config now looks like the following:
name = "a" vcpus = 2 memory = 6000 vif = [ "bridge=br0,mac=aa:ab:ac:ad:ae:af" ] boot = "n" vnc = 1 vncpasswd = "xxxxxxxx" builder = "hvm" acpi = 1 apic = 1 pae = 1 shadow_memory = 16 sdl = 0 vnclisten = "0.0.0.0" vncconsole = 1 stdvga = 0 serial = "pty" usbdevice = "tablet" on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart"