← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1680331] [NEW] Nova boot doesn't tell positional argument completely

 

Public bug reported:

Nova help text for nova boot says that only mandatory arg for cli is
name but thats not true.


=========================================================================================================
[root@greglinux2 ~(keystone_admin)]# 
[root@greglinux2 ~(keystone_admin)]# nova help boot
usage: nova boot [--flavor <flavor>] [--image <image>]
                 [--image-with <key=value>] [--boot-volume <volume_id>]
                 [--snapshot <snapshot_id>] [--min-count <number>]
                 [--max-count <number>] [--meta <key=value>]
                 [--file <dst-path=src-path>] [--key-name <key-name>]
                 [--user-data <user-data>]
                 [--availability-zone <availability-zone>]
                 [--security-groups <security-groups>]
                 [--block-device-mapping <dev-name=mapping>]
                 [--block-device key1=value1[,key2=value2...]]
                 [--swap <swap_size>]
                 [--ephemeral size=<size>[,format=<format>]]
                 [--hint <key=value>]
                 [--nic <net-id=net-uuid,net-name=network-name,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,port-id=port-uuid>]
                 [--config-drive <value>] [--poll] [--admin-pass <value>]
                 [--access-ip-v4 <value>] [--access-ip-v6 <value>]
                 [--description <description>]
                 <name>
 
Boot a new server.
 
Positional arguments:
  <name>                        Name for the new server.
 
Optional arguments:
  --flavor <flavor>             Name or ID of flavor (see 'nova flavor-list').
  --image <image>               Name or ID of image (see 'nova image-list').
  --image-with <key=value>      Image metadata property (see 'nova image-
                                show').
  --boot-volume <volume_id>     Volume ID to boot from.
  --snapshot <snapshot_id>      Snapshot ID to boot from (will create a
                                volume).
  --min-count <number>          Boot at least <number> servers (limited by
                                quota).
  --max-count <number>          Boot up to <number> servers (limited by
                                quota).
  --meta <key=value>            Record arbitrary key/value metadata to
                                /meta_data.json on the metadata server. Can be
                                specified multiple times.
  --file <dst-path=src-path>    Store arbitrary files from <src-path> locally
                                to <dst-path> on the new server. Limited by
                                the injected_files quota value.
  --key-name <key-name>         Key name of keypair that should be created
                                earlier with the command keypair-add.
  --user-data <user-data>       user data file to pass to be exposed by the
                                metadata server.
  --availability-zone <availability-zone>
                                The availability zone for server placement.
  --security-groups <security-groups>
                                Comma separated list of security group names.
  --block-device-mapping <dev-name=mapping>
                                Block device mapping in the format <dev-
                                name>=<id>:<type>:<size(GB)>:<delete-on-
                                terminate>.
  --block-device key1=value1[,key2=value2...]
                                Block device mapping with the keys: id=UUID
                                (image_id, snapshot_id or volume_id only if
                                using source image, snapshot or volume)
                                source=source type (image, snapshot, volume or
                                blank), dest=destination type of the block
                                device (volume or local), bus=device's bus
                                (e.g. uml, lxc, virtio, ...; if omitted,
                                hypervisor driver chooses a suitable default,
                                honoured only if device type is supplied)
                                type=device type (e.g. disk, cdrom, ...;
                                defaults to 'disk') device=name of the device
                                (e.g. vda, xda, ...; if omitted, hypervisor
                                driver chooses suitable device depending on
                                selected bus; note the libvirt driver always
                                uses default device names), size=size of the
                                block device in MB(for swap) and in GB(for
                                other formats) (if omitted, hypervisor driver
                                calculates size), format=device will be
                                formatted (e.g. swap, ntfs, ...; optional),
                                bootindex=integer used for ordering the boot
                                disks (for image backed instances it is equal
                                to 0, for others need to be specified) and
                                shutdown=shutdown behaviour (either preserve
                                or remove, for local destination set to
                                remove).
  --swap <swap_size>            Create and attach a local swap block device of
                                <swap_size> MB.
  --ephemeral size=<size>[,format=<format>]
                                Create and attach a local ephemeral block
                                device of <size> GB and format it to <format>.
  --hint <key=value>            Send arbitrary key/value pairs to the
                                scheduler for custom use.
  --nic <net-id=net-uuid,net-name=network-name,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. net-
                                id: attach NIC to network with this UUID net-
                                name: attach NIC to network with this name
                                (either port-id or net-id or net-name must be
                                provided), v4-fixed-ip: IPv4 fixed address for
                                NIC (optional), v6-fixed-ip: IPv6 fixed
                                address for NIC (optional), port-id: attach
                                NIC to port with this UUID (either port-id or
                                net-id must be provided).
  --config-drive <value>        Enable config drive.
  --poll                        Report the new server boot progress until it
                                completes.
  --admin-pass <value>          Admin password for the instance.
  --access-ip-v4 <value>        Alternative access IPv4 of the instance.
  --access-ip-v6 <value>        Alternative access IPv6 of the instance.
  --description <description>   Description for the server. (Supported by API
                                versions '2.19' - '2.latest')

[root@greglinux2 ~(keystone_admin)]# nova boot rajib_instance
ERROR (CommandError): you need to specify a Flavor ID. >>>>>>>>>>>>>>>>>>>> It asks for flavor id 

[root@greglinux2 ~(keystone_admin)]# nova boot --flavor m1.tiny rajib_instance
ERROR (CommandError): you need to specify at least one source ID (Image, Snapshot, or Volume), a block device mapping or provide a set of properties to match against an image

>>>>>>>>>>>>>>>>>>>>>> Its asks mandatorily for Image/Snapshot/Volume id

[root@greglinux2 ~(keystone_admin)]# nova boot --flavor m1.tiny --image e0b99f5c-985a-445c-a47d-1a0d3265d926 rajib_instance
ERROR (Conflict): Multiple possible networks found, use a Network ID to be more specific. (HTTP 409) (Request-ID: req-de90003e-35cc-4279-87a3-ade443ca6cbf)

>>>>>>>>>>>>>>>> Its asks for network id


[root@greglinux2 ~(keystone_admin)]# nova boot --flavor m1.tiny --image e0b99f5c-985a-445c-a47d-1a0d3265d926 --nic net-id=6deaa034-e828-4526-95d2-b5a3c6a143ac rajib_instance

>>>>>>>>>>>>>>>>>>>>>>>>It works well when flavor image and net-id is
given


+--------------------------------------+-----------------------------------------------+
| Property                             | Value                                         |
+--------------------------------------+-----------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                        |
| OS-EXT-AZ:availability_zone          |                                               |
| OS-EXT-SRV-ATTR:host                 | -                                             |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | -                                             |
| OS-EXT-SRV-ATTR:instance_name        | instance-0000009f                             |
| OS-EXT-STS:power_state               | 0                                             |
| OS-EXT-STS:task_state                | scheduling                                    |
| OS-EXT-STS:vm_state                  | building                                      |
| OS-SRV-USG:launched_at               | -                                             |
| OS-SRV-USG:terminated_at             | -                                             |
| accessIPv4                           |                                               |
| accessIPv6                           |                                               |
| adminPass                            | f3axzeBG3dsh                                  |
| config_drive                         |                                               |
| created                              | 2017-04-06T05:24:18Z                          |
| flavor                               | m1.tiny (1)                                   |
| hostId                               |                                               |
| id                                   | 20a7cda5-f5b3-4e93-9d22-ceb3129d964e          |
| image                                | cirros (e0b99f5c-985a-445c-a47d-1a0d3265d926) |
| key_name                             | -                                             |
| metadata                             | {}                                            |
| name                                 | rajib_instance                                |
| os-extended-volumes:volumes_attached | []                                            |
| progress                             | 0                                             |
| security_groups                      | default                                       |
| status                               | BUILD                                         |
| tenant_id                            | f29439bb99d54dba980631b1ef7bd8cd              |
| updated                              | 2017-04-06T05:24:18Z                          |
| user_id                              | c2a01ca6f6f84d388dbd12c68eaa1d13              |
+--------------------------------------+-----------------------------------------------+
[root@greglinux2 ~(keystone_admin)]# 
[root@greglinux2 ~(keystone_admin)]# 
[root@greglinux2 ~(keystone_admin)]#
 
Hence it looks like  
Positional arguments should be : name,flavor, nic, image or boot-volume or snapshot

** Affects: python-novaclient
     Importance: Undecided
     Assignee: NidhiMittalHada (nidhimittal19)
         Status: In Progress

** Project changed: nova => python-novaclient

** Changed in: python-novaclient
     Assignee: (unassigned) => NidhiMittalHada (nidhimittal19)

** Changed in: python-novaclient
       Status: New => In Progress

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1680331

Title:
  Nova boot doesn't tell positional argument completely

Status in python-novaclient:
  In Progress

Bug description:
  Nova help text for nova boot says that only mandatory arg for cli is
  name but thats not true.


  =========================================================================================================
  [root@greglinux2 ~(keystone_admin)]# 
  [root@greglinux2 ~(keystone_admin)]# nova help boot
  usage: nova boot [--flavor <flavor>] [--image <image>]
                   [--image-with <key=value>] [--boot-volume <volume_id>]
                   [--snapshot <snapshot_id>] [--min-count <number>]
                   [--max-count <number>] [--meta <key=value>]
                   [--file <dst-path=src-path>] [--key-name <key-name>]
                   [--user-data <user-data>]
                   [--availability-zone <availability-zone>]
                   [--security-groups <security-groups>]
                   [--block-device-mapping <dev-name=mapping>]
                   [--block-device key1=value1[,key2=value2...]]
                   [--swap <swap_size>]
                   [--ephemeral size=<size>[,format=<format>]]
                   [--hint <key=value>]
                   [--nic <net-id=net-uuid,net-name=network-name,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,port-id=port-uuid>]
                   [--config-drive <value>] [--poll] [--admin-pass <value>]
                   [--access-ip-v4 <value>] [--access-ip-v6 <value>]
                   [--description <description>]
                   <name>
   
  Boot a new server.
   
  Positional arguments:
    <name>                        Name for the new server.
   
  Optional arguments:
    --flavor <flavor>             Name or ID of flavor (see 'nova flavor-list').
    --image <image>               Name or ID of image (see 'nova image-list').
    --image-with <key=value>      Image metadata property (see 'nova image-
                                  show').
    --boot-volume <volume_id>     Volume ID to boot from.
    --snapshot <snapshot_id>      Snapshot ID to boot from (will create a
                                  volume).
    --min-count <number>          Boot at least <number> servers (limited by
                                  quota).
    --max-count <number>          Boot up to <number> servers (limited by
                                  quota).
    --meta <key=value>            Record arbitrary key/value metadata to
                                  /meta_data.json on the metadata server. Can be
                                  specified multiple times.
    --file <dst-path=src-path>    Store arbitrary files from <src-path> locally
                                  to <dst-path> on the new server. Limited by
                                  the injected_files quota value.
    --key-name <key-name>         Key name of keypair that should be created
                                  earlier with the command keypair-add.
    --user-data <user-data>       user data file to pass to be exposed by the
                                  metadata server.
    --availability-zone <availability-zone>
                                  The availability zone for server placement.
    --security-groups <security-groups>
                                  Comma separated list of security group names.
    --block-device-mapping <dev-name=mapping>
                                  Block device mapping in the format <dev-
                                  name>=<id>:<type>:<size(GB)>:<delete-on-
                                  terminate>.
    --block-device key1=value1[,key2=value2...]
                                  Block device mapping with the keys: id=UUID
                                  (image_id, snapshot_id or volume_id only if
                                  using source image, snapshot or volume)
                                  source=source type (image, snapshot, volume or
                                  blank), dest=destination type of the block
                                  device (volume or local), bus=device's bus
                                  (e.g. uml, lxc, virtio, ...; if omitted,
                                  hypervisor driver chooses a suitable default,
                                  honoured only if device type is supplied)
                                  type=device type (e.g. disk, cdrom, ...;
                                  defaults to 'disk') device=name of the device
                                  (e.g. vda, xda, ...; if omitted, hypervisor
                                  driver chooses suitable device depending on
                                  selected bus; note the libvirt driver always
                                  uses default device names), size=size of the
                                  block device in MB(for swap) and in GB(for
                                  other formats) (if omitted, hypervisor driver
                                  calculates size), format=device will be
                                  formatted (e.g. swap, ntfs, ...; optional),
                                  bootindex=integer used for ordering the boot
                                  disks (for image backed instances it is equal
                                  to 0, for others need to be specified) and
                                  shutdown=shutdown behaviour (either preserve
                                  or remove, for local destination set to
                                  remove).
    --swap <swap_size>            Create and attach a local swap block device of
                                  <swap_size> MB.
    --ephemeral size=<size>[,format=<format>]
                                  Create and attach a local ephemeral block
                                  device of <size> GB and format it to <format>.
    --hint <key=value>            Send arbitrary key/value pairs to the
                                  scheduler for custom use.
    --nic <net-id=net-uuid,net-name=network-name,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. net-
                                  id: attach NIC to network with this UUID net-
                                  name: attach NIC to network with this name
                                  (either port-id or net-id or net-name must be
                                  provided), v4-fixed-ip: IPv4 fixed address for
                                  NIC (optional), v6-fixed-ip: IPv6 fixed
                                  address for NIC (optional), port-id: attach
                                  NIC to port with this UUID (either port-id or
                                  net-id must be provided).
    --config-drive <value>        Enable config drive.
    --poll                        Report the new server boot progress until it
                                  completes.
    --admin-pass <value>          Admin password for the instance.
    --access-ip-v4 <value>        Alternative access IPv4 of the instance.
    --access-ip-v6 <value>        Alternative access IPv6 of the instance.
    --description <description>   Description for the server. (Supported by API
                                  versions '2.19' - '2.latest')

  [root@greglinux2 ~(keystone_admin)]# nova boot rajib_instance
  ERROR (CommandError): you need to specify a Flavor ID. >>>>>>>>>>>>>>>>>>>> It asks for flavor id 

  [root@greglinux2 ~(keystone_admin)]# nova boot --flavor m1.tiny rajib_instance
  ERROR (CommandError): you need to specify at least one source ID (Image, Snapshot, or Volume), a block device mapping or provide a set of properties to match against an image

  >>>>>>>>>>>>>>>>>>>>>> Its asks mandatorily for Image/Snapshot/Volume
  id

  [root@greglinux2 ~(keystone_admin)]# nova boot --flavor m1.tiny --image e0b99f5c-985a-445c-a47d-1a0d3265d926 rajib_instance
  ERROR (Conflict): Multiple possible networks found, use a Network ID to be more specific. (HTTP 409) (Request-ID: req-de90003e-35cc-4279-87a3-ade443ca6cbf)

  >>>>>>>>>>>>>>>> Its asks for network id

  
  [root@greglinux2 ~(keystone_admin)]# nova boot --flavor m1.tiny --image e0b99f5c-985a-445c-a47d-1a0d3265d926 --nic net-id=6deaa034-e828-4526-95d2-b5a3c6a143ac rajib_instance

  >>>>>>>>>>>>>>>>>>>>>>>>It works well when flavor image and net-id is
  given

  
  +--------------------------------------+-----------------------------------------------+
  | Property                             | Value                                         |
  +--------------------------------------+-----------------------------------------------+
  | OS-DCF:diskConfig                    | MANUAL                                        |
  | OS-EXT-AZ:availability_zone          |                                               |
  | OS-EXT-SRV-ATTR:host                 | -                                             |
  | OS-EXT-SRV-ATTR:hypervisor_hostname  | -                                             |
  | OS-EXT-SRV-ATTR:instance_name        | instance-0000009f                             |
  | OS-EXT-STS:power_state               | 0                                             |
  | OS-EXT-STS:task_state                | scheduling                                    |
  | OS-EXT-STS:vm_state                  | building                                      |
  | OS-SRV-USG:launched_at               | -                                             |
  | OS-SRV-USG:terminated_at             | -                                             |
  | accessIPv4                           |                                               |
  | accessIPv6                           |                                               |
  | adminPass                            | f3axzeBG3dsh                                  |
  | config_drive                         |                                               |
  | created                              | 2017-04-06T05:24:18Z                          |
  | flavor                               | m1.tiny (1)                                   |
  | hostId                               |                                               |
  | id                                   | 20a7cda5-f5b3-4e93-9d22-ceb3129d964e          |
  | image                                | cirros (e0b99f5c-985a-445c-a47d-1a0d3265d926) |
  | key_name                             | -                                             |
  | metadata                             | {}                                            |
  | name                                 | rajib_instance                                |
  | os-extended-volumes:volumes_attached | []                                            |
  | progress                             | 0                                             |
  | security_groups                      | default                                       |
  | status                               | BUILD                                         |
  | tenant_id                            | f29439bb99d54dba980631b1ef7bd8cd              |
  | updated                              | 2017-04-06T05:24:18Z                          |
  | user_id                              | c2a01ca6f6f84d388dbd12c68eaa1d13              |
  +--------------------------------------+-----------------------------------------------+
  [root@greglinux2 ~(keystone_admin)]# 
  [root@greglinux2 ~(keystone_admin)]# 
  [root@greglinux2 ~(keystone_admin)]#
   
  Hence it looks like  
  Positional arguments should be : name,flavor, nic, image or boot-volume or snapshot

To manage notifications about this bug go to:
https://bugs.launchpad.net/python-novaclient/+bug/1680331/+subscriptions