더북(TheBook)

4. 커맨드 명령어를 이용하고 싶은데 어떤 명령어가 있고 어떤 파라미터가 있는지 잘 모르겠다면 help 명령어를 이용합니다. 확인하고 싶은 명령어 뒤에–help 옵션을 추가하면 명령어를 어떻게 사용하는지 쉽게 파악할 수 있습니다. 다음은 인스턴스를 생성할 때 커맨드 명령어를 어떻게 이용하면 되는지 알려 줍니다.

nalee@controller:~$ openstack server create –help
usage: openstack server create [-h] [-f {json,shell,table,value,yaml}]
                               [-c COLUMN] [–max-width <integer>]
                               [–noindent] –prefix PREFIX –flavor
                               <flavor>
                               [–security-group <security-group-name>]
                               [–key-name <key-name>]
                               [–property <key=value>]
                               [–file <dest-filename=source-filename>]
                               [–user-data <user-data>]
                               [–availability-zone <zone-name>]
                               [–block-device-mapping <dev-name=mapping>]
                               [–nic <net-id=net-uuid,v4-fixed-ip=ip-addr,v6-
fixed-ip=ip-addr,port-id=port-uuid>]
                               [–hint <key=value>]
                               [–config-drive <config-drive-volume>|True]
                               [–min <count>] [–max <count>] [–wait]
                               <server-name>

Create a new server

positional arguments: <server-name> New server name

optional arguments: -h, –help show this help message and exit –image <image> Create server from this image (name or ID) –volume <volume> Create server from this volume (name or ID) –flavor <flavor> Create server with this flavor (name or ID) –security-group <security-group-name> Security group to assign to this server (name or ID) (repeat option to set multiple groups) –key-name <key-name> Keypair to inject into this server (optional extension) –property <key=value> Set a property on this server (repeat option to set multiple values) –file <dest-filename=source-filename> File to inject into image before boot (repeat option to set multiple files) –user-data <user-data> User data file to serve from the metadata server –availability-zone <zone-name> Select an availability zone for the server –block-device-mapping <dev-name=mapping> Map block devices; map is <id>:<type>:<size(GB)>:<delete_on_terminate> (optional extension) –nic <net-id=net-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,port-id=port-uuid> Create a NIC on the server. Specify option multiple times to create multiple NICs. Either net-id or port- id must be provided, but not both. net-id: attach NIC to network with this UUID, port-id: attach NIC to port with this UUID, v4-fixed-ip: IPv4 fixed address for NIC (optional), v6-fixed-ip: IPv6 fixed address for NIC (optional). –hint <key=value> Hints for the scheduler (optional extension) –config-drive <config-drive-volume>|True Use specified volume as the config drive, or ‘True’ to use an ephemeral drive –min <count> Minimum number of servers to launch (default=1) –max <count> Maximum number of servers to launch (default=1) –wait Wait for build to complete

output formatters: output formatter options

-f {json,shell,table,value,yaml}, –format {json,shell,table,value,yaml} the output format, defaults to table -c COLUMN, –column COLUMN specify the column(s) to include, can be repeated

table formatter: –max-width <integer> Maximum display width, <1 to disable. You can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.