{"id":4332,"date":"2019-04-26T16:16:53","date_gmt":"2019-04-26T10:46:53","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=4332"},"modified":"2019-04-26T16:17:00","modified_gmt":"2019-04-26T10:47:00","slug":"how-to-upload-cloud-images-in-openstack-via-commandline","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-upload-cloud-images-in-openstack-via-commandline\/","title":{"rendered":"How to upload cloud images in OpenStack via commandline"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">How to upload cloud images in OpenStack via commandline<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"mce_0\">Date posted : 12\/04\/2019<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In this article we are going to explain about Openstack images management. Generally this cam be done via Horizon dashboard under Images section. But we will explain how to upload images via commandline.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" width=\"323\" height=\"156\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/download.png\" alt=\"\" class=\"wp-image-4358\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/download.png 323w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/download-300x145.png 300w\" sizes=\"(max-width: 323px) 100vw, 323px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Download an image from internet. We use debian image for example. Login to the server where the glance service is running, in our case it\u2019s a allinone node.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cd \/root<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">wget http:\/\/cdimage.debian.org\/cdimage\/openstack\/current-9\/debian-9-openstack-amd64.qcow2<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Source your keystone admin credentials using below source command<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[root@os ~]# source keystonerc_admin\n[root@os ~(keystone_admin)]#<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Go to the folder where your have place cloud image qcow2 file.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[root@os ~(keystone_admin)]# cd \/root\/\n[root@os ~(keystone_admin)]#<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"mce_8\">To upload an image to glance<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax :<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"> [root@os ~(keystone_admin)]# openstack image create \u2013disk-format qcow2 \u2013container-format bare\u00a0\u00a0 \u2013public \u2013file\u00a0 {Name-Cloud-Image}.qcow2\u00a0\u00a0\u00a0\u00a0 &lt;Name-of-Image><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Example : Let\u2019s assume I want to upload Debian9 qcow2 file.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[root@os ~(keystone_admin)]# openstack image create --disk-format qcow2 --container-format bare --public --file debian-9-openstack-amd64.qcow2  debian1<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1024\" height=\"545\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-25-at-1.44.23-PM-1024x545.png\" alt=\"\" class=\"wp-image-4338\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-25-at-1.44.23-PM-1024x545.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-25-at-1.44.23-PM-300x160.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-25-at-1.44.23-PM-768x409.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/04\/Screen-Shot-2019-04-25-at-1.44.23-PM.png 1440w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">To view the uploaded images<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[root@os ~(keystone_admin)]# openstack image list\n+--------------------------------------+------------+--------+\n| ID                                   | Name       | Status |\n+--------------------------------------+------------+--------+\n| eecc5097-4e5d-4c94-a45b-55086eac58ff | CentOS7    | active |\n| 91269ac5-d934-400f-8e97-bc7a59b33245 | Ubuntu VDK | active |\n| 2e55d18b-262d-4e7a-9d37-3af350a885f7 | cirros     | active |\n| 6be91be3-d1c0-45b2-88d5-295718555bd8 | debian     | active |\n| c3f0db79-d08d-4582-8bd1-e39308aef705 | debian9    | active |\n+--------------------------------------+------------+--------+<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Deleting a Cloud Image <\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Syntax :<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># openstack image delete &lt;Image-Name-or-Image-ID><\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[root@os ~(keystone_admin)]# openstack image delete debian1\n[root@os ~(keystone_admin)]#<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks for using&nbsp;<a href=\"https:\/\/pheonixsolutions.com\/\">pheonix solutions<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You find this tutorial helpful? Share with your friends to keep it alive.<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to upload cloud images in OpenStack via commandline Date posted : 12\/04\/2019 In this article we are going to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1019],"tags":[622],"class_list":["post-4332","post","type-post","status-publish","format-standard","hentry","category-cloud-aws","tag-openstack","psol-cat-cloud-aws"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-17S","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4332","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=4332"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4332\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}