diff --git a/jobs/pipelines/packer-image-create.groovy b/jobs/pipelines/packer-image-create.groovy
new file mode 100644
index 0000000..94133a7
--- /dev/null
+++ b/jobs/pipelines/packer-image-create.groovy
@@ -0,0 +1,114 @@
+/**
+ *
+ * Deploy the product cluster using Jenkins master on CICD cluster
+ *
+ * Expected parameters:
+
+ *   IMAGE_NAME                    Name of the resulting image in the Glance or in artifacts
+
+ *   BUILD_CONFIG_DRIVE_PATH       Relative path in tcp-qa to the directory with meta-data and user-data files
+ *   BUILD_PACKER_CONFIG_PATH      Relative path in tcp-qa to the file with packer config (packer.json)
+ *   BASE_IMAGE_URL                Base image to build a new image, in qcow2. For example, released ubuntu cloud image
+ *   BASE_IMAGE_MD5                Base image MD5 checksum. Image will be re-downloaded if not match with the local image checksum
+
+ *   PACKER_URL                    URL to the zip archive with packer binary, see https://releases.hashicorp.com/packer/
+ *   PACKER_ZIP_MD5                MD5 of the zip archive with packer binary
+
+ *   OS_AUTH_URL                   OpenStack keystone catalog URL
+ *   OS_PROJECT_NAME               OpenStack project (tenant) name
+ *   OS_USER_DOMAIN_NAME           OpenStack user domain name
+ *   OS_CREDENTIALS                OpenStack username and password credentials ID in Jenkins
+ *   UPLOAD_IMAGE_TO_GLANCE        If True: upload image to glance; if False: store as an artifact
+
+ *   TCP_QA_REFS                   Reference to the tcp-qa change on review.gerrithub.io, like refs/changes/46/418546/41
+ */
+
+@Library('tcp-qa')_
+
+def common = new com.mirantis.mk.Common()
+def shared = new com.mirantis.system_qa.SharedPipeline()
+
+timeout(time: 6, unit: 'HOURS') {
+    node () {
+        try {
+
+            stage("Clean the environment and clone tcp-qa") {
+                deleteDir()
+                shared.run_cmd("""\
+                    git clone https://github.com/Mirantis/tcp-qa.git ${WORKSPACE}
+                """)
+                shared.update_working_dir(false)
+                sh "mkdir ./tmp"
+            }
+
+            def packer_zipname = "/tmp/packer.zip"
+            def configdrive_isoname = "./tmp/config-drive.iso"
+
+            stage("Prepare Packer") {
+                // Check that the archive is already downloaded and has a correct checksum. Remove if not match
+                if (fileExists(packer_zipname)) {
+                    sh(script: "bash -cex 'md5sum -c --status <(echo ${PACKER_ZIP_MD5} ${packer_zipname})' || rm -f ${packer_zipname}", returnStdout: true)
+                }
+                // If the file is missing or removed, then download it and check the checksum
+                if (!fileExists(packer_zipname)) {
+                    sh(script: "wget --quiet -O ${packer_zipname} ${PACKER_URL}", returnStdout: true)
+                    // Should fail the job if not match
+                    sh(script: "bash -cex 'md5sum -c --status <(echo ${PACKER_ZIP_MD5} ${packer_zipname})'", returnStdout: true)
+                }
+                sh "unzip ${packer_zipname}"
+            }
+
+            stage("Build the cloudinit ISO") {
+                // Check that genisoimage is installed, or try to install it
+                sh "which genisoimage || sudo apt-get -y install genisoimage"
+                // Generate config-drive ISO
+                sh "mkisofs -o ${configdrive_isoname} -V cidata -r -J --quiet ${BUILD_CONFIG_DRIVE_PATH}"
+            }
+
+            stage("Build the image '${IMAGE_NAME}'") {
+                // Build the image
+                sh (script: """\
+                    set -ex;
+                    export PACKER_LOG=1;
+                    export PACKER_CACHE_DIR='/tmp/packer_cache_${IMAGE_NAME}/';
+                    mkdir -p \${PACKER_CACHE_DIR};
+                    ./packer build -machine-readable -parallel=false -only='qemu' ${BUILD_PACKER_CONFIG_PATH};
+                """, returnStdout: true)
+            }
+
+
+            if (env.UPLOAD_IMAGE_TO_GLANCE) {
+
+                stage("Upload generated config drive ISO into volume on cfg01 node") {
+                    withCredentials([
+                       [$class          : 'UsernamePasswordMultiBinding',
+                       credentialsId   : env.OS_CREDENTIALS,
+                       passwordVariable: 'OS_PASSWORD',
+                       usernameVariable: 'OS_USERNAME']
+                    ]) {
+                        env.OS_IDENTITY_API_VERSION = 3
+
+                        def imagePath = "tmp/${IMAGE_NAME}/${IMAGE_NAME}.qcow2"
+                        shared.run_cmd("""\
+                            openstack --insecure image delete ${IMAGE_NAME} || true
+                            sleep 3
+                            openstack --insecure image create ${IMAGE_NAME} --file ${imagePath} --disk-format qcow2 --container-format bare
+                        """)
+                    }
+                }
+            } else {
+
+                stage("Archive artifacts") {
+                    archiveArtifacts artifacts: "tmp/${IMAGE_NAME}/${IMAGE_NAME}.qcow2"
+                }
+            }
+
+        } catch (e) {
+            common.printMsg("Job is failed", "purple")
+            throw e
+        } finally {
+            // Remove the image after job is finished
+            sh "rm -f ./tmp/${IMAGE_NAME}.qcow2 || true"
+        } // try
+    } // node
+} // timeout
\ No newline at end of file
