| 547 | {{{#!th colspan=2 align=justify |
| 548 | '''Use case''': [=#DestroyingVMsdynamically Destroying VMs dynamically] |
| 549 | }}} |
| 550 | |---------------- |
| 551 | {{{#!td |
| 552 | '''Description''' |
| 553 | }}} |
| 554 | {{{#!td |
| 555 | The DRM4G will check if certain parameters have been met and then will proceed to destroy the VMs |
| 556 | }}} |
| 557 | |---------------- |
| 558 | {{{#!td |
| 559 | '''Primary Actor''' |
| 560 | }}} |
| 561 | {{{#!td |
| 562 | DRM4G |
| 563 | }}} |
| 564 | |---------------- |
| 565 | {{{#!td |
| 566 | '''Preconditions''' |
| 567 | }}} |
| 568 | {{{#!td |
| 569 | * There must be a resource in the configuration defined with the purpose for the creation of VMs |
| 570 | * The user must have already [#Creatingcloudcredentials created his x509 certificate proxy] |
| 571 | }}} |
| 572 | |---------------- |
| 573 | {{{#!td |
| 574 | '''Basic Flow''' |
| 575 | }}} |
| 576 | {{{#!td |
| 577 | 1. For each VM, the DRM4G will check how many jobs it's currently running |
| 578 | 1. If there aren't any jobs, the VM will be given an '''''idle''''' state |
| 579 | a. It will remain in this state until it's assigned a job |
| 580 | 1. If a VM stays '''''idle''''' for a certain amount of time, it will be destroyed |
| 581 | a. If a VM has been marked to be destroyed but the user has already been charged for it, it won't be destroyed until the time it has been hired for has passed |
| 582 | a. If a VM has been marked to be destroyed but a job is assigned to it, it will be given a second chance, but the the second time it gets marked it will be destroyed |
| 583 | }}} |
| 584 | |---------------- |
| 585 | {{{#!td |
| 586 | '''Postconditions''' |
| 587 | }}} |
| 588 | {{{#!td |
| 589 | * The VMs will be correctly destroyed until the number of available VMs reaches "'''''min_nodes'''''" |
| 590 | }}} |
| 591 | |---------------- |
| 592 | {{{#!td |
| 593 | '''Alternate Flow''' |
| 594 | }}} |
| 595 | {{{#!td |
| 596 | 1. If the user has run out of money, all VMs will be destroyed |
| 597 | a. It will wait for the last paid hour to pass before destroying the VM |
| 598 | }}} |
| 599 | |
| 600 | |
| 601 | |
| 602 | |
| 603 | |
| 604 | |
| 605 | [[br]] |
| 606 | |
| 607 | |
| 608 | |
| 609 | |
| 610 | |