- Add --all-starting for pool delnode
This commit is contained in:
Fred Park 2017-09-24 19:50:14 -07:00
Родитель c13793dd57
Коммит 53477a720a
6 изменённых файлов: 32 добавлений и 14 удалений

Просмотреть файл

@ -2,16 +2,19 @@
## [Unreleased]
## [2.9.5] - 2017-09-24
### Added
- Optional `version` support for `platform_image`. This property can be
used to set a host OS version to prevent possible issues that occur with
`latest` image versions.
- `--all-starting` option for `pool delnode` which will delete all nodes
in starting state
### Changed
- Prevent invalid configuration of HPC offers with non-RDMA VM sizes
- Expanded network tuning exemptions for new Dv3 and Ev3 sizes
- Temporarily override Canonical UbuntuServer 16.04-LTS latest version to
a prior version due to recent linux-azure kernel issues.
a prior version due to recent linux-azure kernel issues
### Fixed
- NV driver updates
@ -854,7 +857,8 @@ transfer is disabled
#### Added
- Initial release
[Unreleased]: https://github.com/Azure/batch-shipyard/compare/2.9.4...HEAD
[Unreleased]: https://github.com/Azure/batch-shipyard/compare/2.9.5...HEAD
[2.9.5]: https://github.com/Azure/batch-shipyard/compare/2.9.4...2.9.5
[2.9.4]: https://github.com/Azure/batch-shipyard/compare/2.9.3...2.9.4
[2.9.3]: https://github.com/Azure/batch-shipyard/compare/2.9.2...2.9.3
[2.9.2]: https://github.com/Azure/batch-shipyard/compare/2.9.0rc1...2.9.2

Просмотреть файл

@ -1166,23 +1166,27 @@ def reboot_nodes(batch_client, config, all_start_task_failed, node_id):
def del_node(
batch_client, config, all_start_task_failed, all_unusable, node_id):
# type: (batch.BatchServiceClient, dict, bool, bool, str) -> None
batch_client, config, all_start_task_failed, all_starting,
all_unusable, node_id):
# type: (batch.BatchServiceClient, dict, bool, bool, bool, str) -> None
"""Delete a node in a pool
:param batch_client: The batch client to use.
:type batch_client: `azure.batch.batch_service_client.BatchServiceClient`
:param dict config: configuration dict
:param bool all_start_task_failed: delete all start task failed nodes
:param bool all_starting: delete all starting nodes
:param bool all_unusable: delete all unusable nodes
:param str node_id: node id to delete
"""
node_ids = []
pool_id = settings.pool_id(config)
if all_start_task_failed or all_unusable:
if all_start_task_failed or all_starting or all_unusable:
filters = []
if all_start_task_failed:
filters.append('(state eq \'starttaskfailed\')')
if all_unusable:
elif all_starting:
filters.append('(state eq \'starting\')')
elif all_unusable:
filters.append('(state eq \'unusable\')')
nodes = list(
batch_client.compute_node.list(

Просмотреть файл

@ -2534,23 +2534,27 @@ def action_pool_ssh(batch_client, config, cardinal, nodeid, tty, command):
def action_pool_delnode(
batch_client, config, all_start_task_failed, all_unusable, nodeid):
# type: (batchsc.BatchServiceClient, dict, bool, bool, str) -> None
batch_client, config, all_start_task_failed, all_starting,
all_unusable, nodeid):
# type: (batchsc.BatchServiceClient, dict, bool, bool, bool, str) -> None
"""Action: Pool Delnode
:param azure.batch.batch_service_client.BatchServiceClient batch_client:
batch client
:param dict config: configuration dict
:param bool all_start_task_failed: delete all start task failed nodes
:param bool all_starting: delete all starting nodes
:param bool all_unusable: delete all unusable nodes
:param str nodeid: nodeid to delete
"""
_check_batch_client(batch_client)
if (all_start_task_failed or all_unusable) and nodeid is not None:
if ((all_start_task_failed or all_starting or all_unusable) and
nodeid is not None):
raise ValueError(
'cannot specify all start task failed nodes or unusable with '
'a specific node id')
batch.del_node(
batch_client, config, all_start_task_failed, all_unusable, nodeid)
batch_client, config, all_start_task_failed, all_starting,
all_unusable, nodeid)
def action_pool_rebootnode(

Просмотреть файл

@ -22,4 +22,4 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
__version__ = '2.9.4'
__version__ = '2.9.5'

Просмотреть файл

@ -504,6 +504,7 @@ Azure Storage.
* `delnode` will delete the specified node from the pool
* `--all-start-task-failed` will delete all nodes in the start task
failed state
* `--all-starting` will delete all nodes in the starting state
* `--all-unusable` will delete all nodes in the unusable state
* `--nodeid` is the node id to delete
* `dsu` will delete the SSH user defined in the pool configuration file

Просмотреть файл

@ -1189,6 +1189,10 @@ def pool_ssh(ctx, cardinal, nodeid, tty, command):
'--all-start-task-failed',
is_flag=True,
help='Delete all nodes in start task failed state')
@click.option(
'--all-starting',
is_flag=True,
help='Delete all nodes in starting state')
@click.option(
'--all-unusable',
is_flag=True,
@ -1200,12 +1204,13 @@ def pool_ssh(ctx, cardinal, nodeid, tty, command):
@keyvault_options
@aad_options
@pass_cli_context
def pool_delnode(ctx, all_start_task_failed, all_unusable, nodeid):
def pool_delnode(
ctx, all_start_task_failed, all_starting, all_unusable, nodeid):
"""Delete a node from a pool"""
ctx.initialize_for_batch()
convoy.fleet.action_pool_delnode(
ctx.batch_client, ctx.config, all_start_task_failed, all_unusable,
nodeid)
ctx.batch_client, ctx.config, all_start_task_failed, all_starting,
all_unusable, nodeid)
@pool.command('rebootnode')