guest_drive_type: Adds guest drive configuration options 33/19333/2
authorChristian Trautman <ctrautma@redhat.com>
Tue, 23 Aug 2016 10:31:39 +0000 (06:31 -0400)
committerMaryam Tahhan <maryam.tahhan@intel.com>
Wed, 24 Aug 2016 08:42:58 +0000 (08:42 +0000)
Adds boot and mounted drive configuration options.

JIRA: VSPERF-379

Change-Id: Ic0673a9b9f7a3430d7ac4db5fb9bf4228872f501
signed-off-by: Christian Trautman <ctrautma@redhat.com>

conf/04_vnf.conf
vnfs/qemu/qemu.py

index ec24266..8069ef0 100644 (file)
@@ -37,6 +37,11 @@ GUEST_IMAGE = ['', '', '', '', '', '']
 # For 2 VNFs you may use [180, 180]
 GUEST_TIMEOUT = [180, 180, 180, 180, 180, 180]
 
+# Guest images may require different drive types such as ide to mount shared
+# locations and/or boot correctly. You can modify the types here.
+GUEST_BOOT_DRIVE_TYPE = 'scsi'
+GUEST_SHARED_DRIVE_TYPE = 'scsi'
+
 # packet forwarding mode supported by testpmd; Please see DPDK documentation
 # for comprehensive list of modes supported by your version.
 # e.g. io|mac|mac_retry|macswap|flowgen|rxonly|txonly|csum|icmpecho|...
index b5eaddc..e91eaa2 100644 (file)
@@ -85,7 +85,8 @@ class IVnfQemu(IVnf):
                      '-m', S.getValue('GUEST_MEMORY')[self._number],
                      '-smp', str(S.getValue('GUEST_SMP')[self._number]),
                      '-cpu', 'host,migratable=off',
-                     '-drive', 'if=scsi,file=' +
+                     '-drive', 'if={},file='.format(S.getValue(
+                        'GUEST_BOOT_DRIVE_TYPE')) +
                      S.getValue('GUEST_IMAGE')[self._number],
                      '-boot', 'c', '--enable-kvm',
                      '-monitor', 'unix:%s,server,nowait' % self._monitor,
@@ -97,8 +98,9 @@ class IVnfQemu(IVnf):
                      '-nographic', '-vnc', str(vnc), '-name', name,
                      '-snapshot', '-net none', '-no-reboot',
                      '-drive',
-                     'if=scsi,format=raw,file=fat:rw:%s,snapshot=off' %
-                     S.getValue('GUEST_SHARE_DIR')[self._number],
+                     'if=%s,format=raw,file=fat:rw:%s,snapshot=off' %
+                     (S.getValue('GUEST_SHARED_DRIVE_TYPE'),
+                      S.getValue('GUEST_SHARE_DIR')[self._number]),
                     ]
         self._configure_logging()