2015-11-28 19 views
0

我正嘗試使用打包工具在trystack服務器上創建並上傳基於Ubuntu的圖像。我正在使用Windows操作系統來執行此操作。我創建了一個示例模板並加載了一個用於使用廚師設置環境變量的腳本文件。但是,當我運行封隔器生成命令我得到使用Packer工具在TryStack服務器上上傳圖像

1 error(s) occurred: 

* Get /: unsupported protocol scheme "" 

什麼是我在這個失蹤?

這裏是模板和腳本文件

template.json

{ 
    "builders": [ 
     { 
      "type": "openstack", 
      "ssh_username": "root", 
      "image_name": "sensor-cloud", 
      "source_image": "66a14661-2dfb-4370-b6d4-87aaefcffdce", 
      "flavor": "3", 
      "availability_zone": "nova", 
      "security_groups": ["mySecurityGroup"] 
     } 
    ], 
    "provisioners": [ 
     { 
      "type": "file", 
      "source": "sensorCloudCookbook.zip", 
      "destination": "/tmp/sensorCloudCookbook.zip" 
     }, 
     { 
      "type": "shell", 
      "inline": [ 
       "curl -L https://www.opscode.com/chef/install.sh | bash" 
      ], 
      "execute_command": "chmod +x {{ .Path }}; sudo -E {{ .Path }}" 
     }, 
     { 
      "type": "shell", 
      "inline": [ 
       "unzip /tmp/sensorCloudCookbook.zip -d /tmp/sensorCloudCookbook" 
      ], 
      "execute_command": "chmod +x {{ .Path }}; sudo -E {{ .Path }}" 
     }, 
     { 
      "type": "shell", 
      "inline": [ 
       "chef-solo -c /tmp/sensorCloudCookbook/solo.rb -l info -L /tmp/sensorCloudLogs.txt" 
      ], 
      "execute_command": "chmod +x {{ .Path }}; sudo -E {{ .Path }}" 
     } 
    ] 
} 

openstack-config.sh

#!/bin/bash 

# To use an OpenStack cloud you need to authenticate against the Identity 
# service named keystone, which returns a **Token** and **Service Catalog**. 
# The catalog contains the endpoints for all services the user/tenant has 
# access to - such as Compute, Image Service, Identity, Object Storage, Block 
# Storage, and Networking (code-named nova, glance, keystone, swift, 
# cinder, and neutron). 
# 
# *NOTE*: Using the 2.0 *Identity API* does not necessarily mean any other 
# OpenStack API is version 2.0. For example, your cloud provider may implement 
# Image API v1.1, Block Storage API v2, and Compute API v2.0. OS_AUTH_URL is 
# only for the Identity API served through keystone. 
export OS_AUTH_URL=http://128.136.179.2:5000/v2.0 

# With the addition of Keystone we have standardized on the term **tenant** 
# as the entity that owns the resources. 
export OS_TENANT_ID=trystack_tenant_id 
export OS_TENANT_NAME="trystack_tenant_name" 
export OS_PROJECT_NAME="trystack_project_name" 

# In addition to the owning entity (tenant), OpenStack stores the entity 
# performing the action as the **user**. 
export OS_USERNAME="same_as_trystack_tenant_name" 

# With Keystone you pass the keystone password. 
echo "Please enter your OpenStack Password: " 
read -sr OS_PASSWORD_INPUT 
export OS_PASSWORD=$OS_PASSWORD_INPUT 

# If your configuration has multiple regions, we set that information here. 
# OS_REGION_NAME is optional and only valid in certain environments. 
export OS_REGION_NAME="RegionOne" 
# Don't leave a blank variable, unset it if it was empty 
if [ -z "$OS_REGION_NAME" ]; then unset OS_REGION_NAME; fi 

回答

1

您需要打包構建之前,源openstack-config.sh