# openstack image list7 n d: h6 w9 w
+--------------------------------------+----------------------------+
( p& w& K& Y3 J( k| ID | Name |9 v( B2 r4 T. X1 o7 V9 W h6 P: t
+--------------------------------------+----------------------------+
1 V( `6 G; m: x| ae262f2b-c79c-4b94-9b65-2039cffa856b | Nis-tests-img
0 F8 h& {3 r; l0 K, x$ i+ I, X+ v( g5 a. J( s8 x3 G
# openstack image show Nis-tests-img
" P1 b0 g% s" }) `" ^9 V+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+& t" X7 t* v* C# {! {: n
| Field | Value |/ x. |$ I9 @( Q- P' |0 O3 m; h
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
6 b G: R R! j3 d( o| checksum | d47de1f69c46058550d81f6a0ca961f1 |
, A+ m- ?. \! L% {4 D# F9 [| container_format | bare |& s7 m* L& v' T1 @
| created_at | 2017-11-10T09:50:18Z |2 U0 ?5 x0 n5 Y2 a
| disk_format | qcow2 |
0 j: ~' Y6 a2 C$ P* w6 Y' B$ f| file | /v2/images/ae262f2b-c79c-4b94-9b65-2039cffa856b/file |/ q+ t( U Q6 w* t
| id | ae262f2b-c79c-4b94-9b65-2039cffa856b |
* x* k5 |! _" x( j2 P| min_disk | 120 |% l% x+ N6 Z! t% V4 T# H% s
| min_ram | 0 |
3 p+ B5 b) S- Y! `8 Q| name | Nis-tests-img |3 u" N& S8 Z7 @9 H3 e4 z4 g
| owner | e7a7b1f7bd5047c699fb333416341de8 |
$ r6 O% T2 u+ }| properties | base_image_ref='0150c9f4-a6cf-41c2f', image_location='snapshot', image_state='available', image_type='snapshot', instance_uuid='22011666-9414c6932a', kernel_id='None', owner_id='e7a7b1f7bd5047c699fb333416341de8', ramdisk_id='None', user_id='baf7787e10d14f81b922db814e0ad155' |
7 I. a! k: j6 f" F" o| protected | False |
( b3 r5 t X2 k( M| schema | /v2/schemas/image |9 U4 {+ z6 v; z% q; B' d6 \
| size | 1558904832 |9 M9 Z7 Z& s: _- T
| status | active |
. A* w0 C5 A+ \| updated_at | 2017-11-10T09:52:03Z |
) Z8 {( b/ y/ z& p| virtual_size | None |
9 M3 p! K2 W2 K$ D& X. V( y2 P| visibility | private |# F: @! p; y* ^) u6 f, C; ^
+------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
$ B. ^5 s) R* t" ^1 L# p) Z
/ O* l9 K1 w) ^2 _; e5 w# i- y4 IWhen viewing a list of images, you can also use grep to filter thelist, as follows:
7 M% u/ U2 V$ q& l8 v& w( s$ openstack image list | grep 'cirros'| dfc1dfb0-d7bf-4fff-8994-319dd6f703d7 | cirros-0.3.5-x86_64-uec | active || a3867e29-c7a1-44b0-9e7f-10db587cad20 | cirros-0.3.5-x86_64-uec-kernel | active || 4b916fba-6775-4092-92df-f41df7246a6b | cirros-0.3.5-x86_64-uec-ramdisk | active |
* A W9 f; C& p) [! {
- t8 w# \2 k+ }1 e9 j7 B+ G4 u- a$ ?5 y; g* @+ j7 l
1 G/ [' T* [7 J% R0 Q, \
Note
i" |, k. l- I: W& M. X5 FTo store location metadata for images, which enables direct file access for a client,update the /etc/glance/glance-api.conf file with the following statements:
7 ~, n2 ^6 t) h[{ "id": "2d9bb53f-70ea-4066-a68b-67960eaae673", "mountpoint": "/var/lib/glance/images/"}]
5 H6 v. b8 c# e1 ^$ k% W' F) R- ~4 S6 I- O& F* E7 s5 Y. @
After you restart the Image service, you can use the following syntax to viewthe image’s location information:
9 I5 ] x5 U& ]$ openstack --os-image-api-version 2 image show imageID
" u$ I6 S) z0 N4 o. U9 `
7 M5 P3 L% L% {9 l# J4 ~( a/ OFor example, using the image ID shown above, you would issue the command as follows:6 M b. D: u, |) F* _8 a
$ openstack --os-image-api-version 2 image show 2d9bb53f-70ea-4066-a68b-67960eaae673" r8 y" T2 F" v# U, v8 o
! Z9 H8 K) t$ j2 j, N
/ x2 x: z3 I4 p% w9 v* l/ j: }4 R. i" j: c# U* D" f/ ^
Create or update an image (glance)¶To create an image, use openstack image create:. f6 f6 }$ \6 u* @
$ openstack image create imageName
) m, ?* F' i3 Z6 N
* J4 L- a0 Y# q. zTo update an image by name or ID, use openstack image set:( m, r7 o+ a/ H
$ openstack image set imageName# W7 `5 H4 K0 w: W% g
4 d' {, r* O1 P0 eThe following list explains the optional arguments that you can use withthe create and set commands to modify image properties. Formore information, refer to the OpenStack Image command reference.
/ u" m! R' |8 O% qThe following example shows the command that you would use to upload aCentOS 6.3 image in qcow2 format and configure it for public access:+ V$ f, `! ~0 Z# p
$ openstack image create --disk-format qcow2 --container-format bare \ --public --file ./centos63.qcow2 centos63-image
, ^ b& ]2 y3 `, H/ s/ ]5 b4 f( A8 m. z9 A
The following example shows how to update an existing image with aproperties that describe the disk bus, the CD-ROM bus, and the VIFmodel:8 t3 q D$ F5 M$ I" Q
+ E, U9 C0 k" ?7 n# F' s: R
' Q p) ~8 @4 Y3 r$ F! W
Note
( Z6 `& O* p% d' JWhen you use OpenStack with VMware vCenter Server, you need to specifythe vmware_disktype and vmware_adaptertype properties withopenstack image create.Also, we recommend that you set the hypervisor_type="vmware" property.For more information, see Images with VMware vSpherein the OpenStack Configuration Reference.
+ L% X+ `* T2 d, {5 [$ openstack image set \ --property hw_disk_bus=scsi \ --property hw_cdrom_bus=ide \ --property hw_vif_model=e1000 \ f16-x86_64-openstack-sda
& S5 c& {% m0 O' T! u+ ?7 m) G2 g }% H: m
Currently the libvirt virtualization tool determines the disk, CD-ROM,and VIF device models based on the configured hypervisor type(libvirt_type in /etc/nova/nova.conf file). For the sake of optimalperformance, libvirt defaults to using virtio for both disk and VIF(NIC) models. The disadvantage of this approach is that it is notpossible to run operating systems that lack virtio drivers, for example,BSD, Solaris, and older versions of Linux and Windows.0 z! } u( x T$ ]2 L# x$ [
If you specify a disk or CD-ROM bus model that is not supported, seethe Disk_and_CD-ROM_bus_model_values_table.If you specify a VIF model that is not supported, the instance fails tolaunch. See the VIF_model_values_table.7 J' B. N! e- w! k" Y& l1 |4 F% H6 x
The valid model values depend on the libvirt_type setting, as shownin the following tables.
7 w4 i7 ~5 ?- C5 M+ s* {Disk and CD-ROM bus model values libvirt_type settingSupported model values
; P9 \( e6 k7 k* j& D% @6 Nqemu or kvm- ide
- scsi
- virtio
; b! t4 G& x: o. `! | / K( a2 I+ W- i0 n0 S
xenVIF model values libvirt_type settingSupported model values! [- e2 L2 G" K: c6 i& l
qemu or kvm- e1000
- ne2k_pci
- pcnet
- rtl8139
- virtio8 W W4 X4 J9 {0 b% J8 e4 ~$ I" ]
1 \. G. l& m8 R4 Jxen- e1000
- netfront
- ne2k_pci
- pcnet
- rtl8139
0 I& C( L4 T; |0 r# [, H 5 _" E& F6 I7 N. G* [$ l: a
vmware- VirtualE1000
- VirtualPCNet32
- VirtualVmxnet2 Q( E0 O/ t$ s& ?& }
/ U- j1 `& {0 g m B
5 [9 u, G) o; t2 eNote+ u; P# D# a* K1 N; _7 b
By default, hardware properties are retrieved from the imageproperties. However, if this information is not available, thelibosinfo database provides an alternative source for thesevalues.
7 \5 z9 @& C$ OIf the guest operating system is not in the database, or if the useof libosinfo is disabled, the default system values are used./ Q) F: @6 t& J( u% h; V) b
Users can set the operating system ID or a short-id in imageproperties. For example:% k9 l' G7 r& I1 t" q; X5 ~' B
$ openstack image set --property short-id=fedora23 \ name-of-my-fedora-image
% ~ p4 e; R. Y- g& U. P# H) R
2 a+ W; X, W& t- lAlternatively, users can set id to a URL:
0 b3 ^4 j: U* T: X& Y+ w$ openstack image set \ --property id=http://fedoraproject.org/fedora/23 \ ID-of-my-fedora-image
( \6 W2 _: F8 e" C8 x' I; I( U! y$ R3 X A5 o
2 C5 f& h; }- p
Create an image from ISO image¶You can upload ISO images to the Image service (glance).You can subsequently boot an ISO image using Compute.
5 ~, U: m h% l5 X( f( CIn the Image service, run the following command:4 j# G/ r8 O( Z$ k( O' L0 f
$ openstack image create ISO_IMAGE --file IMAGE.iso \ --disk-format iso --container-format bare
# W& L! j- N9 v) s0 j% l* H( w5 Z3 ?( U; e ~5 A# Z# J' t
Optionally, to confirm the upload in Image service, run:/ ]) ~4 ^! a4 _- O& B
$ openstack image list
- D, g. ?2 d8 G2 @( }
, U. s6 V/ q |8 s) g5 ^" g. z- G) a* l. w, g% v, L# E
7 k" P0 u! |2 Z
Troubleshoot image creation¶If you encounter problems in creating an image in the Image service orCompute, the following information may help you troubleshoot thecreation process.
9 P: Y- H$ |0 }; t: @1 \- Ensure that the version of qemu you are using is version 0.14 orlater. Earlier versions of qemu result in an unknown option -serror message in the /var/log/nova/nova-compute.log file.
- Examine the /var/log/nova/nova-api.log and/var/log/nova/nova-compute.log log files for error messages.& e: U+ g0 W n! ^; K
( F7 `* @& o# b- n r5 w% z3 V. S/ L, C, W7 u
( s5 D+ x( k4 h0 @, J0 o. V
|