@base.remotable
    def create(self):
        if self.obj_attr_is_set('id'):
            raise exception.ObjectActionError(action='create',
                                              reason='already created')
        updates = self.obj_get_changes()
        if 'migration_type' not in updates:
            raise exception.ObjectActionError(
                action="create",
                reason="cannot create a Migration object without a "
                       "migration_type set")
        db_migration = db.migration_create(self._context, updates)
        self._from_db_object(self._context, self, db_migration)
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/objects/migration.py/Migration.create/original