kvmadm icon indicating copy to clipboard operation
kvmadm copied to clipboard

error handling bug at zone creation

Open gumpp opened this issue 8 years ago • 1 comments

The import using file test01.json (see below) failed, because rpool/zones was not mounted to /zones but to /rpool, i.e. not to where it was expected. In the first place the zonepath did not exist actually, but kvmadm offered to correct it. However, this also failed due to the wrong path (non-existing /zones directory). After that kvm complained about a missing repository.db in /zones/test01/root/...

This problem still existed when trying to import test01.json again.

{
   "test01" : {
      "disk" : [
         {
            "index" : "0",
            "boot" : "true",
            "disk_path" : "rpool/zones/test01/kvm0",
            "model" : "virtio",
            "disk_size" : "50G",
            "cache" : "none"
         },
         {
            "index" : "1",
            "media" : "cdrom",
            "disk_path" : "/export/iso/CentOS-7-x86_64-Minimal-1511.iso",
            "model" : "ide",
            "cache" : "none"
         }
      ],
      "serial" : [
         {
            "index" : "0",
            "serial_name" : "console"
         }
      ],
      "nic" : [
         {
            "index" : "0",
            "over" : "e1000g0",
            "nic_name" : "kvmtest01",
            "model" : "e1000"
         },
         {
            "index" : "1",
            "over" : "switch0",
            "nic_name" : "vnictest01",
            "model" : "e1000"
         }
      ],
      "zone" : {
         "zonepath" : "/zones/test01",
         "bootargs" : "",
         "hostid" : "",
         "brand" : "lipkg",
         "fs-allowed" : "",
         "scheduling-class" : "",
         "pool" : "",
         "autoboot" : "false",
         "limitpriv" : "default",
         "ip-type" : "exclusive",
         "fs" : [
            {
               "special" : "/etc/opt/kvmadm/myvncpw",
               "options" : "[ro,nodevices]",
               "type" : "lofs",
               "dir" : "/etc/opt/kvmadm/myvncpw"
            }
         ]
      },
      "vnc" : "socket",
      "uuid" : "ed228d46-7862-4a43-93dd-c0ad975fa930",
      "hpet" : "false",
      "boot_order" : "cd",
      "vcpus" : "4",
      "vnc_pw_file" : "/etc/opt/kvmadm/myvncpw",
      "time_base" : "utc",
      "ram" : "2048"
   }
}

Here the error:

root@tron:/root# /opt/kvmadm-0.11.0/bin/kvmadm import test01.json ->
zvol rpool/zones/test01/kvm0 does not exist. creating it...
svc.configd: Fatal error: /zones/test01/root/etc/svc/repository.db:
integrity check failed. Details in /etc/svc/volatile/db_errors
svccfg: Repository server failed (exit 102).
setting up system/kvm within zone. this might take a while...
svccfg: Pattern 'svc:/system/kvm' doesn't match any instances or services
svc.configd: Fatal error: /zones/test01/root/etc/svc/repository.db:
integrity check failed. Details in /etc/svc/volatile/db_errors
svccfg: Repository server failed (exit 102).
svc.configd: Fatal error: /zones/test01/root/etc/svc/repository.db:
integrity check failed. Details in /etc/svc/volatile/db_errors
svccfg: Repository server failed (exit 102).
ERROR: cannot add 'system/kvm'
Do you want to retry [Y/n]? y
svc.configd: Fatal error: /zones/test01/root/etc/svc/repository.db:
integrity check failed. Details in /etc/svc/volatile/db_errors
svccfg: Repository server failed (exit 102).
setting up system/kvm within zone. this might take a while...
svccfg: Pattern 'svc:/system/kvm' doesn't match any instances or services
svc.configd: Fatal error: /zones/test01/root/etc/svc/repository.db:
integrity check failed. Details in /etc/svc/volatile/db_errors
svccfg: Repository server failed (exit 102).
svc.configd: Fatal error: /zones/test01/root/etc/svc/repository.db:
integrity check failed. Details in /etc/svc/volatile/db_errors
svccfg: Repository server failed (exit 102).
ERROR: cannot add 'system/kvm'
Do you want to retry [Y/n]? n

kvmadm list also produced the same error message.

gumpp avatar Nov 26 '16 19:11 gumpp

the zonepath property can only be set on creation of a zone and should point to the zone root mountpoint.

if you do zonecfg -z test01 info you will see the mountpoint of the zone. can you boot that zone manually?

zonepath is a mandatory property so it has to be provided by the user on creation/import of a kvm setting. is it possible that the zone did already exist when you have done the import but w/ the wrong zonepath property?

hadfl avatar Nov 27 '16 12:11 hadfl