diff --git a/create-arista-veos-image/create-arista-veos-image.sh b/create-arista-veos-image/create-arista-veos-image.sh
index 5dbd7bac5bad19a6ce0d6dd0e2b94b8fe391784f..c71ee6ac59a07c1b88250e093b2fed04f5b91114 100644
--- a/create-arista-veos-image/create-arista-veos-image.sh
+++ b/create-arista-veos-image/create-arista-veos-image.sh
@@ -1,11 +1,12 @@
 #!/bin/bash
-# create-arista-veos-image.sh V1.12
+# create-arista-veos-image.sh V1.2
 # HS-Fulda - sebastian.rieger@informatik.hs-fulda.de
 #
 # changelog:
 # V1.1   added injection of config defined in VM Maestro using config-drivex
 # V1.11  fixed device mapping of extracted partitions, fixed problems with stale swi directory
 # V1.12  rc.eos now supports e1000 and virtio as vnic types (virtio is supported in vEOS >=4.14.5F)
+# V1.2   added dynamic handling of device mapping of extacted partitions
 
 # usage
 if [ ! $# -eq 3 ] ; then
@@ -43,9 +44,11 @@ echo "==========================================================="
 
 # convert vmdk to raw and extract two partitions in it
 qemu-img convert -O raw $2 $VEOS_VMDK_BASENAME.raw
-kpartx -av $VEOS_VMDK_BASENAME.raw
-dd if=/dev/mapper/loop0p1 of=$VEOS_VMDK_BASENAME-p1.raw
-dd if=/dev/mapper/loop0p2 of=$VEOS_VMDK_BASENAME-p2.raw
+LOOPDEV=$(kpartx -av $VEOS_VMDK_BASENAME.raw)
+LOOPDEV_PART1=$(echo "$LOOPDEV" | sed '1q;d' | cut -d " " -f 3)
+LOOPDEV_PART2=$(echo "$LOOPDEV" | sed '2q;d' | cut -d " " -f 3)
+dd if=/dev/mapper/$LOOPDEV_PART1 of=$VEOS_VMDK_BASENAME-p1.raw
+dd if=/dev/mapper/$LOOPDEV_PART2 of=$VEOS_VMDK_BASENAME-p2.raw
 kpartx -d $VEOS_VMDK_BASENAME.raw
 
 echo
@@ -127,9 +130,11 @@ t
 w" | fdisk $TMP_NAME.raw >/dev/null
 
 # copy the partitions from vEOS vmdk to new image
-kpartx -av $TMP_NAME.raw
-dd if=$VEOS_VMDK_BASENAME-p1.raw of=/dev/mapper/loop0p2
-dd if=$VEOS_VMDK_BASENAME-p2.raw of=/dev/mapper/loop0p3
+LOOPDEV=$(kpartx -av $TMP_NAME.raw)
+LOOPDEV_PART2=$(echo "$LOOPDEV" | sed '2q;d' | cut -d " " -f 3)
+LOOPDEV_PART3=$(echo "$LOOPDEV" | sed '3q;d' | cut -d " " -f 3)
+dd if=$VEOS_VMDK_BASENAME-p1.raw of=/dev/mapper/$LOOPDEV_PART2
+dd if=$VEOS_VMDK_BASENAME-p2.raw of=/dev/mapper/$LOOPDEV_PART3
 kpartx -d $TMP_NAME.raw
 
 echo
diff --git a/create-arista-veos-image/dynamic-subtype-vEOS.json b/create-arista-veos-image/dynamic-subtype-vEOS.json
index 3173fe6d251dbe915a32756b0d15bea14015c016..64bb030bc2f670bc648e93d9e26d9d794684c6fb 100644
--- a/create-arista-veos-image/dynamic-subtype-vEOS.json
+++ b/create-arista-veos-image/dynamic-subtype-vEOS.json
@@ -1,20 +1,24 @@
 {
-    "plugin_name": "vEOS", 
-    "cli_serial": 1, 
-    "plugin_desc": "Arista vEOS", 
-    "baseline_image": "vEOS", 
-    "hw_ram": 1024, 
-    "hw_vm_extra": "", 
-    "interface_wrap": 7, 
-    "config_disk_type": "disk", 
-    "interface_pattern": "Ethernet{0}", 
-    "gui_visible": true, 
-    "config_file": "/veos_config.txt", 
-    "interface_first": 1, 
-    "gui_icon": "iosvl2", 
-    "plugin_base": "generic", 
-    "vnc_available": false, 
-    "interface_management": "Management1", 
-    "interface_range": 7, 
-    "baseline_flavor": "vEOS.small"
+  "dynamic-subtypes": [
+    {
+      "plugin_name": "vEOS", 
+      "cli_serial": 1, 
+      "plugin_desc": "Arista vEOS", 
+      "baseline_image": "vEOS", 
+      "hw_ram": 1024, 
+      "hw_vm_extra": "", 
+      "interface_wrap": 7, 
+      "config_disk_type": "disk", 
+      "interface_pattern": "Ethernet{0}", 
+      "gui_visible": true, 
+      "config_file": "/veos_config.txt", 
+      "interface_first": 1, 
+      "gui_icon": "iosvl2", 
+      "plugin_base": "generic", 
+      "vnc_available": false, 
+      "interface_management": "Management1", 
+      "interface_range": 7, 
+      "baseline_flavor": "vEOS.small"
+    }
+  ]
 }
\ No newline at end of file