+$(DESCRIPTOR_DIR)/vnfd/cirros_vnf/build/%.tar.gz:
+ $(MAKE) -C $(DESCRIPTOR_DIR)/vnfd/cirros_vnf
+
+$(DESCRIPTOR_DIR)/nsd/cirros_ns/build/%.tar.gz:
+ $(MAKE) -C $(DESCRIPTOR_DIR)/nsd/cirros_ns
+
+images/cache/cirros-0.3.5-x86_64-disk.img:
+ $(Q)mkdir -p images/cache
+ $(Q)wget http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img -O $@
+
+images/cache/Fedora-x86_64-20-20131211.1-sda-ping.qcow2:
+ $(Q)mkdir -p images/cache
+ $(Q)wget ftp://osm-download.etsi.org/examples/ping_pong_ns/images/Fedora-x86_64-20-20131211.1-sda-ping.qcow2 -O $@
+
+images/cache/Fedora-x86_64-20-20131211.1-sda-pong.qcow2:
+ $(Q)mkdir -p images/cache
+ $(Q)wget ftp://osm-download.etsi.org/examples/ping_pong_ns/images/Fedora-x86_64-20-20131211.1-sda-pong.qcow2 -O $@
+
+# images are prefixed with 'osm/' to separate osm uploaded images from VIM installed images
+OSM_IMAGE_PREFIX ?=
+
+ifdef OS_AUTH_URL
+images/%.qcow2 images/%.img:
+ $(Q)openstack image show $(OSM_IMAGE_PREFIX)$(shell basename $@) || \
+ sh -c "make images/cache/$(shell basename $@) && openstack image create --file images/cache/$(shell basename $@) $(OSM_IMAGE_PREFIX)$(shell basename $@)"
+else
+images/%.img:
+ echo "No method selected to upload image to VIM"
+endif
+
+cirros: check_OSM_HOSTNAME check_openstack_env \
+ $(DESCRIPTOR_DIR)/vnfd/cirros_vnf/build/cirros_vnf.tar.gz \
+ $(DESCRIPTOR_DIR)/nsd/cirros_ns/build/cirros_ns.tar.gz \
+ images/cirros-0.3.5-x86_64-disk.img