HPE Morpheus VM Essentials Software
1856205 Members
13013 Online
104110 Solutions
New Discussion

Re: Create VM using 2 qcow2 files

 
Jlentine
Member

Create VM using 2 qcow2 files

Trying to create a Cisco Umbrella VM inside Morpheus VM Essentials.

The problem is, I need to use (2) Qcow2 files it gives you and have 2 hdd's on the vm. I was able to create a plan that has (2) HDD's but cannot find a way when creating the instance to apply File 1 to drive 1 and file 2 to drive 2....

2. Launch the Virtual Appliance on KVM

2 REPLIES 2
Jlentine
Member

Re: Create VM using 2 qcow2 files

Antoniy from support was able to answer this for me. Steps below:

 

There is no such option in the GUI yet.

 

You can add a second qcow file with a workaround manually on the command line.

 

Create the VM with 2 disks.

 

  • Power Off the VM.
  • Dump the xml file (VM configuration file).
  • Find the disk location in the config file.
  • Delete the second disk.
  • Copy the qcow to the same location and rename it to the same name as disk 2.
  • Power on the VM, it should use the qcow as second disk.

 

 

The command to dump the vm configuration file to xml is:

virsh dumpxml <vm-name> > /tmp/<vm-name>.xml

cbunge
HPE Pro

Re: Create VM using 2 qcow2 files

There is a way to do this in the UI.

If you are uploading as a virtual image, you need to create directory that contains your qcow files (the vdisks) and a metadata.json file that describes the disks (similar to a very basic vmx file).

I do this with my Packer builds for KVM here:
https://github.com/BungeBash/Packer-Public

Specifically this line outputs my disks:
 "cat > ${var.templates_directory}/${local.vm_name}/metadata.json <<EOF\n{\"disks\":[{\"capacity\":${var.vDisk * 1024 * 1024 * 1024},\"guestDeviceName\":\"vda\",\"position\":0,\"name\":\"root\",\"file\":\"${local.vm_name}.qcow2\"}]}\nEOF",

 

Structure of the metadata.json is:

{
	"disks": [
		{
			"capacity" 6442450944,
			"guestDeviceName": "vda",
			"position": 0,
			"name": "root",
			"file": "ubuntu_319165-disk-0.qcow2"
		},
		{
			"capacity" 6442450944,
			"guestDeviceName": "vdb",
			"position": 1,
			"name": "data",
			"file": "ubuntu_319165-disk-1.qcow2"
		}
	]
}

Once you place the metadata.json and qcow2 files in a folder, zip the folder and upload via Library -> Virtual Images in Morpheus.

If you click the 'cog' icon next to an existing Virtual Image and choose 'Download' it will show you the zip structure with the metadata.json file as well.