@attr(tags=['advanced', 'advancedns', 'simulator', 'api', 'basic', 'eip', 'sg'])
def test_deployVmOnGivenHost(self):
    'Test deploy VM on specific host\n        '
    hosts = Host.list(self.apiclient, zoneid=self.zone.id, type='Routing', state='Up', listall=True)
    self.assertEqual(isinstance(hosts, list), True, 'CS should have atleast one host Up and Running')
    host = hosts[0]
    self.debug(('Deploting VM on host: %s' % host.name))
    try:
        vm = VirtualMachine.create(self.apiclient, self.services['virtual_machine'], templateid=self.template.id, accountid=self.account.name, domainid=self.account.domainid, serviceofferingid=self.service_offering.id, hostid=host.id)
        self.debug('Deploy VM succeeded')
    except Exception as e:
        self.fail(('Deploy VM failed with exception: %s' % e))
    self.debug('Cheking the state of deployed VM')
    vms = VirtualMachine.list(self.apiclient, id=vm.id, listall=True, account=self.account.name, domainid=self.account.domainid)
    self.assertEqual(isinstance(vms, list), True, 'List Vm should return a valid response')
    vm_response = vms[0]
    self.assertEqual(vm_response.state, 'Running', 'VM should be in running state after deployment')
    self.assertEqual(vm_response.hostid, host.id, 'Host id where VM is deployed should match')
    return
Test deploy VM on specific host
@attr(tags=['advanced', 'advancedns', 'simulator', 'api', 'basic', 'eip', 'sg'])
def test_deployVmOnGivenHost(self):
    '\n        '
    hosts = Host.list(self.apiclient, zoneid=self.zone.id, type='Routing', state='Up', listall=True)
    self.assertEqual(isinstance(hosts, list), True, 'CS should have atleast one host Up and Running')
    host = hosts[0]
    self.debug(('Deploting VM on host: %s' % host.name))
    try:
        vm = VirtualMachine.create(self.apiclient, self.services['virtual_machine'], templateid=self.template.id, accountid=self.account.name, domainid=self.account.domainid, serviceofferingid=self.service_offering.id, hostid=host.id)
        self.debug('Deploy VM succeeded')
    except Exception as e:
        self.fail(('Deploy VM failed with exception: %s' % e))
    self.debug('Cheking the state of deployed VM')
    vms = VirtualMachine.list(self.apiclient, id=vm.id, listall=True, account=self.account.name, domainid=self.account.domainid)
    self.assertEqual(isinstance(vms, list), True, 'List Vm should return a valid response')
    vm_response = vms[0]
    self.assertEqual(vm_response.state, 'Running', 'VM should be in running state after deployment')
    self.assertEqual(vm_response.hostid, host.id, 'Host id where VM is deployed should match')
    return