code: def migrate(gandi, resource, force, background, finalize):
      
      if not gandi.iaas.check_can_migrate(resource):
          return
  
      if not force:
          proceed = click.confirm('Are you sure you want to migrate VM %s ?'
                                  % resource)
          if not proceed:
              return
  
      if finalize:
          gandi.iaas.need_finalize(resource)
  
      output_keys = ['id', 'type', 'step']
      oper = gandi.iaas.migrate(resource, background, finalize=finalize)
      if background:
          output_generic(gandi, oper, output_keys)
  
      return oper
docs: Migrate a virtual machine to another datacenter.