@attr(tags=['advanced', 'eip', 'advancedns', 'basic', 'sg'])
def test_07_deploy_startvm_attach_iso(self):
    'Test Deploy Virtual Machine with startVM=false and attach ISO\n        '
    self.debug(('Deploying instance in the account: %s' % self.account.name))
    self.virtual_machine = VirtualMachine.create(self.apiclient, self.services['virtual_machine'], accountid=self.account.name, domainid=self.account.domainid, serviceofferingid=self.service_offering.id, startvm=False, diskofferingid=self.disk_offering.id)
    self.debug(('Deployed instance in account: %s' % self.account.name))
    list_vm_response = list_virtual_machines(self.apiclient, id=self.virtual_machine.id)
    self.debug(('Verify listVirtualMachines response for virtual machine: %s' % self.virtual_machine.id))
    self.assertEqual(isinstance(list_vm_response, list), True, 'Check list response returns a valid list')
    vm_response = list_vm_response[0]
    self.assertEqual(vm_response.state, 'Stopped', 'VM should be in Stopped state after deployment with startvm=false')
    self.debug(('Registering a ISO in account: %s' % self.account.name))
    iso = Iso.create(self.apiclient, self.services['iso'], account=self.account.name, domainid=self.account.domainid)
    self.debug(('Successfully created ISO with ID: %s' % iso.id))
    try:
        iso.download(self.apiclient)
        self.cleanup.append(iso)
    except Exception as e:
        self.fail(('Exception while downloading ISO %s: %s' % (iso.id, e)))
    self.debug(('Attach ISO with ID: %s to VM ID: %s' % (iso.id, self.virtual_machine.id)))
    try:
        self.virtual_machine.attach_iso(self.apiclient, iso)
    except Exception as e:
        self.fail('Attach ISO failed!')
    vms = VirtualMachine.list(self.apiclient, id=self.virtual_machine.id, listall=True)
    self.assertEqual(isinstance(vms, list), True, 'List vms should return a valid list')
    vm = vms[0]
    self.assertEqual(vm.isoid, iso.id, 'The ISO status should be reflected in list Vm call')
    return
Test Deploy Virtual Machine with startVM=false and attach ISO
@attr(tags=['advanced', 'eip', 'advancedns', 'basic', 'sg'])
def test_07_deploy_startvm_attach_iso(self):
    '\n        '
    self.debug(('Deploying instance in the account: %s' % self.account.name))
    self.virtual_machine = VirtualMachine.create(self.apiclient, self.services['virtual_machine'], accountid=self.account.name, domainid=self.account.domainid, serviceofferingid=self.service_offering.id, startvm=False, diskofferingid=self.disk_offering.id)
    self.debug(('Deployed instance in account: %s' % self.account.name))
    list_vm_response = list_virtual_machines(self.apiclient, id=self.virtual_machine.id)
    self.debug(('Verify listVirtualMachines response for virtual machine: %s' % self.virtual_machine.id))
    self.assertEqual(isinstance(list_vm_response, list), True, 'Check list response returns a valid list')
    vm_response = list_vm_response[0]
    self.assertEqual(vm_response.state, 'Stopped', 'VM should be in Stopped state after deployment with startvm=false')
    self.debug(('Registering a ISO in account: %s' % self.account.name))
    iso = Iso.create(self.apiclient, self.services['iso'], account=self.account.name, domainid=self.account.domainid)
    self.debug(('Successfully created ISO with ID: %s' % iso.id))
    try:
        iso.download(self.apiclient)
        self.cleanup.append(iso)
    except Exception as e:
        self.fail(('Exception while downloading ISO %s: %s' % (iso.id, e)))
    self.debug(('Attach ISO with ID: %s to VM ID: %s' % (iso.id, self.virtual_machine.id)))
    try:
        self.virtual_machine.attach_iso(self.apiclient, iso)
    except Exception as e:
        self.fail('Attach ISO failed!')
    vms = VirtualMachine.list(self.apiclient, id=self.virtual_machine.id, listall=True)
    self.assertEqual(isinstance(vms, list), True, 'List vms should return a valid list')
    vm = vms[0]
    self.assertEqual(vm.isoid, iso.id, 'The ISO status should be reflected in list Vm call')
    return