allocate_machine and destroy_machine