# metalcloud-cli drive update-hosts Update host assignments for a drive ## Synopsis Update host assignments for a drive within an infrastructure using JSON configuration. This command updates the host assignments for a drive. You can assign or remove hosts from the drive. The host configuration must be provided via JSON file or stdin pipe. Arguments: infrastructure_id_or_label The ID or label of the infrastructure drive_id The unique identifier of the drive Required Flags: --config-source string Source of the drive hosts configuration Can be 'pipe' (for stdin input) or path to a JSON file Examples: ## Update drive host assignments from JSON file metalcloud-cli drive update-hosts my-infrastructure 12345 --config-source hosts.json ## Update hosts from stdin echo '{"host_ids": [123, 456]}' | metalcloud-cli drive update-hosts my-infrastructure 12345 --config-source pipe ## Update using hosts configuration file metalcloud-cli drive hosts-update 1001 67890 --config-source /path/to/hosts.json ``` metalcloud-cli drive update-hosts infrastructure_id_or_label drive_id [flags] ``` ### Options ``` --config-source string Source of the drive hosts configuration. Can be 'pipe' or path to a JSON file. -h, --help help for update-hosts ``` ### Options inherited from parent commands ``` -k, --api_key string MetalCloud API key -c, --config string Config file path -d, --debug Set to enable debug logging -e, --endpoint string MetalCloud API endpoint -f, --format string Output format. Supported values are 'text','csv','md','json','yaml'. (default "text") -i, --insecure_skip_verify Set to allow insecure transport -l, --log_file string Log file path -v, --verbosity string Log level verbosity (default "INFO") ``` ### SEE ALSO * [metalcloud-cli drive](/content/configuration/cli/metalcloud-cli_drive.md) - Manage drives within infrastructures #### Auto generated by spf13/cobra on 11-Aug-2025