Message ID | 20190916093445.20507-4-bala24@linux.ibm.com |
---|---|
State | New |
Headers | show |
Series | Add acceptance test for migration | expand |
* Balamuruhan S (bala24@linux.ibm.com) wrote: > add migration test to query machine types supported by qemu binary > and migrate vm will all supported type. > > Signed-off-by: Balamuruhan S <bala24@linux.ibm.com> Depending on the architecture you might find that some machine types aren't migratable while some are. Dave > --- > tests/acceptance/migration.py | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py > index 0f3553c8f0..74416ccc21 100644 > --- a/tests/acceptance/migration.py > +++ b/tests/acceptance/migration.py > @@ -49,3 +49,29 @@ class Migration(Test): > self.assertEqual(dest_vm.command('query-status')['status'], 'running') > self.assertEqual(source_vm.command('query-status')['status'], > 'postmigrate') > + > + > + def test_migration_with_machine_types(self): > + migration_port = self._get_free_port() > + for machine in self.get_machine_types(): > + if 'pseries' in machine: > + print("migrating with machine type - {}".format(machine)) > + source_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine)) > + dest_uri = 'tcp:localhost:%u' % migration_port > + dest_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine), > + '-incoming', dest_uri) > + dest_vm.launch() > + source_vm.launch() > + source_vm.qmp('migrate', uri=dest_uri) > + wait.wait_for( > + self.migration_finished, > + timeout=self.timeout, > + step=0.1, > + args=(source_vm,) > + ) > + self.assertEqual(source_vm.command('query-migrate')['status'], > + 'completed') > + self.assertEqual(dest_vm.command('query-status')['status'], > + 'running') > + self.assertEqual(source_vm.command('query-status')['status'], > + 'postmigrate') > -- > 2.14.5 > > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
On Mon, Sep 16, 2019 at 03:50:06PM +0100, Dr. David Alan Gilbert wrote: > * Balamuruhan S (bala24@linux.ibm.com) wrote: > > add migration test to query machine types supported by qemu binary > > and migrate vm will all supported type. > > > > Signed-off-by: Balamuruhan S <bala24@linux.ibm.com> > > Depending on the architecture you might find that some machine types > aren't migratable while some are. Thanks Dave, is there a way to query/check whether a machine type on the architecture is migratable or should we try migrating and handle exception on failure ? -- Bala > > Dave > > > --- > > tests/acceptance/migration.py | 26 ++++++++++++++++++++++++++ > > 1 file changed, 26 insertions(+) > > > > diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py > > index 0f3553c8f0..74416ccc21 100644 > > --- a/tests/acceptance/migration.py > > +++ b/tests/acceptance/migration.py > > @@ -49,3 +49,29 @@ class Migration(Test): > > self.assertEqual(dest_vm.command('query-status')['status'], 'running') > > self.assertEqual(source_vm.command('query-status')['status'], > > 'postmigrate') > > + > > + > > + def test_migration_with_machine_types(self): > > + migration_port = self._get_free_port() > > + for machine in self.get_machine_types(): > > + if 'pseries' in machine: > > + print("migrating with machine type - {}".format(machine)) > > + source_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine)) > > + dest_uri = 'tcp:localhost:%u' % migration_port > > + dest_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine), > > + '-incoming', dest_uri) > > + dest_vm.launch() > > + source_vm.launch() > > + source_vm.qmp('migrate', uri=dest_uri) > > + wait.wait_for( > > + self.migration_finished, > > + timeout=self.timeout, > > + step=0.1, > > + args=(source_vm,) > > + ) > > + self.assertEqual(source_vm.command('query-migrate')['status'], > > + 'completed') > > + self.assertEqual(dest_vm.command('query-status')['status'], > > + 'running') > > + self.assertEqual(source_vm.command('query-status')['status'], > > + 'postmigrate') > > -- > > 2.14.5 > > > > > -- > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
* Balamuruhan S (bala24@linux.ibm.com) wrote: > On Mon, Sep 16, 2019 at 03:50:06PM +0100, Dr. David Alan Gilbert wrote: > > * Balamuruhan S (bala24@linux.ibm.com) wrote: > > > add migration test to query machine types supported by qemu binary > > > and migrate vm will all supported type. > > > > > > Signed-off-by: Balamuruhan S <bala24@linux.ibm.com> > > > > Depending on the architecture you might find that some machine types > > aren't migratable while some are. > > Thanks Dave, is there a way to query/check whether a machine type on the > architecture is migratable or should we try migrating and handle exception > on failure ? I don't know a way to detect it; you can add -only-migratable to get qemu to fai early if a device is declared as being non-migratable; but that still doesn't say that all the devices have actually been tested migrating. Dave > -- Bala > > > > Dave > > > > > --- > > > tests/acceptance/migration.py | 26 ++++++++++++++++++++++++++ > > > 1 file changed, 26 insertions(+) > > > > > > diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py > > > index 0f3553c8f0..74416ccc21 100644 > > > --- a/tests/acceptance/migration.py > > > +++ b/tests/acceptance/migration.py > > > @@ -49,3 +49,29 @@ class Migration(Test): > > > self.assertEqual(dest_vm.command('query-status')['status'], 'running') > > > self.assertEqual(source_vm.command('query-status')['status'], > > > 'postmigrate') > > > + > > > + > > > + def test_migration_with_machine_types(self): > > > + migration_port = self._get_free_port() > > > + for machine in self.get_machine_types(): > > > + if 'pseries' in machine: > > > + print("migrating with machine type - {}".format(machine)) > > > + source_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine)) > > > + dest_uri = 'tcp:localhost:%u' % migration_port > > > + dest_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine), > > > + '-incoming', dest_uri) > > > + dest_vm.launch() > > > + source_vm.launch() > > > + source_vm.qmp('migrate', uri=dest_uri) > > > + wait.wait_for( > > > + self.migration_finished, > > > + timeout=self.timeout, > > > + step=0.1, > > > + args=(source_vm,) > > > + ) > > > + self.assertEqual(source_vm.command('query-migrate')['status'], > > > + 'completed') > > > + self.assertEqual(dest_vm.command('query-status')['status'], > > > + 'running') > > > + self.assertEqual(source_vm.command('query-status')['status'], > > > + 'postmigrate') > > > -- > > > 2.14.5 > > > > > > > > -- > > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
On Tue, Sep 17, 2019 at 10:44:25AM +0100, Dr. David Alan Gilbert wrote: > * Balamuruhan S (bala24@linux.ibm.com) wrote: > > On Mon, Sep 16, 2019 at 03:50:06PM +0100, Dr. David Alan Gilbert wrote: > > > * Balamuruhan S (bala24@linux.ibm.com) wrote: > > > > add migration test to query machine types supported by qemu binary > > > > and migrate vm will all supported type. > > > > > > > > Signed-off-by: Balamuruhan S <bala24@linux.ibm.com> > > > > > > Depending on the architecture you might find that some machine types > > > aren't migratable while some are. > > > > Thanks Dave, is there a way to query/check whether a machine type on the > > architecture is migratable or should we try migrating and handle exception > > on failure ? > > I don't know a way to detect it; you can add -only-migratable to get > qemu to fai early if a device is declared as being non-migratable; but > that still doesn't say that all the devices have actually been tested > migrating. At present we kind of have an informal distinction between those machine types that are mature and maintained enough to support migration (which I think is just pc, q35, pseries and arm virt) and those which aren't. There isn't, as far as I know, a way to detect this. I know we've mentioned at least briefly the idea of formalizing this distinction at qemu summit, but I don't think the discussion went anywhere.
diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py index 0f3553c8f0..74416ccc21 100644 --- a/tests/acceptance/migration.py +++ b/tests/acceptance/migration.py @@ -49,3 +49,29 @@ class Migration(Test): self.assertEqual(dest_vm.command('query-status')['status'], 'running') self.assertEqual(source_vm.command('query-status')['status'], 'postmigrate') + + + def test_migration_with_machine_types(self): + migration_port = self._get_free_port() + for machine in self.get_machine_types(): + if 'pseries' in machine: + print("migrating with machine type - {}".format(machine)) + source_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine)) + dest_uri = 'tcp:localhost:%u' % migration_port + dest_vm = self.get_vm('-M', '{},cap-htm=off'.format(machine), + '-incoming', dest_uri) + dest_vm.launch() + source_vm.launch() + source_vm.qmp('migrate', uri=dest_uri) + wait.wait_for( + self.migration_finished, + timeout=self.timeout, + step=0.1, + args=(source_vm,) + ) + self.assertEqual(source_vm.command('query-migrate')['status'], + 'completed') + self.assertEqual(dest_vm.command('query-status')['status'], + 'running') + self.assertEqual(source_vm.command('query-status')['status'], + 'postmigrate')
add migration test to query machine types supported by qemu binary and migrate vm will all supported type. Signed-off-by: Balamuruhan S <bala24@linux.ibm.com> --- tests/acceptance/migration.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)