XCP Tutorial - Memory Issues with New VMs

As a continuation on my previous XCP Tutorial, I wanted to share some experiences with memory problems that have been a hindrance in my successful installation of new VMs on XCP.
1) Too much memory is taken up in my local storage repository (SR) – with each attempt to create a new VM, memory is put aside on your machine, Virtual Disk Image (VDI), and if you don’t use the VM you will need to release that memory. I discovered that I had about 15 extra VDIs on my machine that was taking memory. Here is what I did:
a) Run xe sr-list type=lvm
RETURN:
uuid ( RO)                : 07ec20ab-5088-67b1-50fe-a46cc689bc98
name-label ( RW): Local storage
name-description ( RW):
host ( RO): xenserver-reiazupz
type ( RO): lvm
content-type ( RO): user
b) Run xe vdi-list sr-uuid=07ec20ab-5088-67b1-50fe-a46cc689bc98
RETURN: ** In my case I had 15 different uuid (RO) that were listed, I only present 1 example
uuid ( RO)                : f3ace49e-6afe-4d96-befb-3b86910ea4b0
name-label ( RW): 0
name-description ( RW): Created by template provisioner
sr-uuid ( RO): 07ec20ab-5088-67b1-50fe-a46cc689bc98
virtual-size ( RO): 8589934592
sharable ( RO): false
read-only ( RO): false
c) Run xe vdi-destroy uuid=xxx for each uuid (RO) that you wish to destroy
2) Not enough free memory to run the VM – each server only has so much available memory for each additional VM that you try and start. Here are some commands you can run to determine how much memory is available, how much memory your VM is requesting, and how you can adjust the VM memory request.
a) Determine Amount of Memory Available on Machine
Run xe host-compute-free-memory
RETURN: 664014848
In my example, I only had 664 MB of memory available for a new VM to run in
b) Determine Amount of Memory VM is requesting (use your VM uuid)
Run xe vm-param-list uuid=f0ddc908-79a9-ea0f-7a22-17c8c4bd983c | grep ” memory-”
RETURN:
memory-actual ( RO): 0
memory-target ( RO): 0
memory-overhead ( RO): 1048576
memory-static-max ( RW): 1073741824
memory-dynamic-max ( RW): 1073741824
memory-dynamic-min ( RW): 1073741824
memory-static-min ( RW): 536870912
In this example, my VM was requesting 1 GB of memory so I needed to adjust the VM memory sizes as I only had 664 MB available.  The following commands allow you to update the memory for your individual VM.
c) Update VM Memory Requirements
Run these four commands in the order listed below for specfic VM uuid and in this example for 512 MB:
xe vm-param-set uuid=fc84c8f0-3be0-8b05-95db-966b9460d3ac memory-static-min=512000000
xe vm-param-set uuid=fc84c8f0-3be0-8b05-95db-966b9460d3ac memory-dynamic-min=512000000
xe vm-param-set uuid=fc84c8f0-3be0-8b05-95db-966b9460d3ac memory-dynamic-max=512000000
xe vm-param-set uuid=fc84c8f0-3be0-8b05-95db-966b9460d3ac memory-static-max=512000000

After these commands I checked my VM memory requirements and got the following:
xe vm-param-list uuid=f0ddc908-79a9-ea0f-7a22-17c8c4bd983c | grep ” memory-”
memory-actual ( RO): 0
memory-target ( RO): 0
memory-overhead ( RO): 1048576
memory-static-max ( RW): 512000000
memory-dynamic-max ( RW): 512000000
memory-dynamic-min ( RW): 512000000
memory-static-min ( RW): 512000000

Read more

Xen Project Announces Performance and Security Advancements with Release of 4.19
Aug 05 2024

New release marks significant enhancements in performance, security, and versatility across various architectures.  SAN FRANCISCO – July 31st, 2024 – The Xen Project, an open source project under the Linux Foundation, is proud to announce the release of Xen Project 4.19. This release marks a significant milestone in enhancing performance, security,

Upcoming Closure of Xen Project Colo Facility
Jul 10 2024

Dear Xen Community, We regret to inform you that the Xen Project is currently experiencing unexpected changes due to the sudden shutdown of our colocated (colo) data center facility by Synoptek. This incident is beyond our control and will impact the continuity of OSSTest (the gating Xen Project CI loop)

Xen Summit Talks Now Live on YouTube!
Jun 18 2024

Hello Xen Community! We have some thrilling news to share with you all. The highly anticipated talks from this year’s Xen Summit are now live on YouTube! Whether you attended the summit in person or couldn’t make it this time, you can now access all the insightful presentations

Get ready for Xen Summit 2024!
May 24 2024

With less than 2 weeks to go, are you ready? The Xen Project is gearing up for a summit full of discussions, collaboration and innovation. If you haven’t already done so – get involved by submitting a design session topic. Don’t worry if you can’t attend in person,