How to build a custom image for XenServer?


As title, I want to create a custom image for XenServer, and follow the link “Creating a Morpheus VMware Image” to config the cloud-init, but when I provisioning by using this image, it will be stuck and failed.
Is any formal step to create a custom image for XenServer?

Hello @WillyChen,

I don’t believe there is a formal document for creating an image for specifically XenServer. That said, the steps are very similar, at least what I performed. Here are some steps I found to be successful:

  1. Create a new VM and install your OS via ISO. In my case, it was CentOS 8 Stream
  2. Once the OS is installed, install the guest tools on the VM following the Citrix Docs
    a. Note that I found I needed to run the following command for CentOS 8 Stream when installing, as the script cannot detect stream as a supported OS:
    ./ -d centos -m 8
  3. At a minimum, install the following packages using yum:
    • cloud-init
    • cloud-utils-growpart
  4. Turn off the VM and convert the VM to a Template
  5. Morpheus should sync the template automatically on the next interval or you can refresh the cloud by going to Infrastructure > Clouds > #your cloud# > Refresh > Short
  6. Once the refresh has completed, navigate to Library > Virtual Images and change from “user” type to “sync” type and locate your template
  7. Once located, edit the template. Ensure cloud-init is checked and Install Agent (if you want it installed). Also, be sure to choose your OS type, as this will help ensure the proper commands/settings are pushed. Here is an example from my environment:
  8. Save any changes to the Virtual Image
  9. You should now be able to deploy the template in Morpheus. When creating the VM, in the console of XenCenter (if you are using it) you should see the DVD Drive have an ISO attached that contain the settings for cloud-init. As well, you should see cloud-init initiate when looking at the console. Examples:
  10. Final results:

I hope that helps!

Dear @kgawronski ,

Can I know how to config the ISO Library (NFS/CIFS) on XenServer?

It seems I can’t attach the ISO that contains the settings for cloud-init.

Hi @WillyChen,

In my case, I am using XenCenter to perform it. I attached a remote SMB/CIFS share as a Storage Repository by highlighting the XenServer and clicking Storage from the top menu and choosing New SR...

Once chosen, we see the following page and I followed the prompts adding the appropriate info for the SMB/CIFS location.

If you are doing this from the command line of the XenServer, I see the following document from them: