def METHOD_NAME(database, task, resize_target, retry_from):
    number_of_instances_before_task = database.infra.last_vm_created
    number_of_instances = 1
    # se vindo de um retry, traz informacoes da maintenance original
    source_offer = retry_from.source_offer if retry_from else database.infra.offering
    target_offer = retry_from.target_offer if retry_from else database.get_future_offering(resize_target)
    base_snapshot = retry_from.base_snapshot if retry_from and retry_from.base_snapshot is not None else None
    auto_upgrade_vm = DatabaseAutoUpgradeVMOffering()
    auto_upgrade_vm.task = task
    auto_upgrade_vm.database = database
    auto_upgrade_vm.resize_target = resize_target
    auto_upgrade_vm.source_offer = source_offer
    auto_upgrade_vm.target_offer = target_offer  
    auto_upgrade_vm.number_of_instances = number_of_instances
    auto_upgrade_vm.number_of_instances_before = number_of_instances_before_task
    auto_upgrade_vm.base_snapshot = base_snapshot
    auto_upgrade_vm.save()
    return auto_upgrade_vm, number_of_instances, number_of_instances_before_task