joyent/smartos-live — Issue #39: `vmadm destroy` strips off pool name in multi-disk KVM setups
Author: bdha
Created: 2012-01-12 08:04:52+00:00
State: open

Note the dataset returned by vmadm destroy compared to what is actually configured ("dataset/UUID" vs "tank/dataset/UUID")

# cat kvm.json
{
"nics" : [
{
"gateway" : "10.21.200.1",
"ip" : "10.21.200.108",
"model" : "virtio",
"netmask" : "255.255.255.0",
"nic_tag" : "admin",
"resolvers" : "10.1.1.92"
}
],
"dns_domain" : "immunet.com", "brand" : "kvm",
"hostname" : "testfoo", "disks" : [
{
"boot" : true,
"image_name" : "fc14_x86_64",
"image_uuid" : "templates/fc14_x86_64",
"model" : "virtio", "size" : 10240
},
{
"boot" : false,
"media" : "disk", "model" : "virtio",
"zpool" : "tank/data", "size" : "102400"
}
],
"default_gateway" : "10.21.200.1",
"vcpus" : "2",
"autoboot" : true, "alias" : "testfoo",
"ram" : "1024",
"qemu_extra_opts" : "\"-no-hpet\""
}

# zfs list -t all | grep 49df3a66-0417-499c-bebb-8742d910ee18 tank/data/49df3a66-0417-499c-bebb-8742d910ee18-disk1 44.5K 11.3T 44.5K -
zones/49df3a66-0417-499c-bebb-8742d910ee18 114K 10.0G 83.5K /zones/49df3a66-0417-499c-bebb-8742d910ee18
zones/49df3a66-0417-499c-bebb-8742d910ee18-disk0 2.60M 226G 1.48G -
zones/49df3a66-0417-499c-bebb-8742d910ee18/cores 31K 2.25G 31K /zones/49df3a66-0417-499c-bebb-8742d910ee18/cores
zones/templates/fc14_x86_64@49df3a66-0417-499c-bebb-8742d910ee18-disk0 0 - 1.48G -

# vmadm destroy 49df3a66-0417-499c-bebb-8742d910ee18
Command failed: cannot open 'data/49df3a66-0417-499c-bebb-8742d910ee18-disk1': dataset does not exist

# zfs list -t all | grep 49df3a66-0417-499c-bebb-8742d910ee18 tank/data/49df3a66-0417-499c-bebb-8742d910ee18-disk1 44.5K 11.3T 44.5K -
zones/templates/fc14_x86_64@49df3a66-0417-499c-bebb-8742d910ee18-disk0 0 - 1.48G -

Note that this also means the config is not destroyed, so if you attempt to "vmadm create" with a zone with the same IP, you get an error and run into #38.

If vmadm destroy is parsing startvm to get all "-drive" elements, it may be misparsing ""file=/dev/zvol/rdsk/tank/data/93de230c-4c12-4236-9c3a-08b514950d92-disk1"?