Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vsphere-clone error with msgpack on destroying #11101

Closed
MichaelSweikata opened this issue Jun 16, 2021 · 7 comments
Closed

vsphere-clone error with msgpack on destroying #11101

MichaelSweikata opened this issue Jun 16, 2021 · 7 comments
Labels

Comments

@MichaelSweikata
Copy link

Overview of the Issue

I have a container running packer, and during the post-provisioner stage to convert it to an ovf and then push up to my cluster, and after the ovf is pushed to the cluster, there's an error message reported. I can't see there being an actual error in the logs or in the image created.

Reproduction Steps

This is my command to generate the image, where sensitive information is passed to the CLI from env variables.

packer build -force -var image_name='coco-linux-centos7-template' -var clone_name="coco-linux-centos7-test-${GITLAB_USER_LOGIN}-${timestamp}" -var vsphere_username=${vsphere_username} -var vsphere_password=${vsphere_password} -var packer_username=${packer_username} -var packer_password=${packer_password} -var-file=./vmware/lebanon.pkvars.hcl -only=vsphere-clone.linux_centos_7 ./vmware/linux.pkr.hcl

Packer version

2021/06/16 17:44:12 [INFO] Packer version: 1.7.2 [go1.16.3 linux amd64]

Simplified Packer Buildfile

This is the post-processor step for the provisioning.

post-processors {
        post-processor "vsphere" {
            host = var.vsphere_server
            username = var.vsphere_username
            password = var.vsphere_password
            insecure = true
            
            cluster = var.vsphere_cluster
            datacenter = var.vsphere_datacenter
            datastore = var.vsphere_datastore

            esxi_host = "lebpresxilp06.prod.buildonetech.co"
            
            vm_name = "${var.clone_name}-${local.timestamp}"
            vm_folder = "${var.vsphere_folder}"
            vm_network = "${var.network}"
            disk_mode = "thin"
            overwrite = true

        }
    }

Operating system and Environment details

Centos7 container running packer that calls ansible, and provisioning to vSphere.

Log Fragments and crash.log files

==> vsphere-clone.linux_centos_7: Running post-processor:  (type vsphere)
    vsphere-clone.linux_centos_7 (vsphere): Uploading centos7/coco-linux-centos7-test-sweikatam-1744-202106.ovf to vSphere
    vsphere-clone.linux_centos_7 (vsphere): Validating Username and Password with dry-run
    vsphere-clone.linux_centos_7 (vsphere): Calling OVFtool to upload vm
    vsphere-clone.linux_centos_7 (vsphere): Opening OVF source: centos7/coco-linux-centos7-test-sweikatam-1744-202106.ovf
    vsphere-clone.linux_centos_7 (vsphere): The manifest validates
    vsphere-clone.linux_centos_7 (vsphere): Opening VI target: vi://[MASKED]@lebadvcenvl01.support.buildonetech.co:443/LEBANON_DATACENTER/host/LEB_MX7000_Cluster
    vsphere-clone.linux_centos_7 (vsphere): Deleting VM: coco-linux-centos7-test-sweikatam-1744-202106
    vsphere-clone.linux_centos_7 (vsphere): Deploying to VI: vi://[MASKED]@lebadvcenvl01.support.buildonetech.co:443/LEBANON_DATACENTER/host/LEB_MX7000_Cluster
    vsphere-clone.linux_centos_7 (vsphere): Transfer Completed
    vsphere-clone.linux_centos_7 (vsphere): Completed successfully
Build 'vsphere-clone.linux_centos_7' errored after 11 minutes 49 seconds: 1 error(s) occurred:
* Error destroying builder artifact: reading body msgpack decode error [pos 1102]: reflect.Set: value of type map[interface {}]interface {} is not assignable to type error; bad artifact: []string(nil)
==> Wait completed after 11 minutes 49 seconds
==> Some builds didn't complete successfully and had errors:
--> vsphere-clone.linux_centos_7: 1 error(s) occurred:
* Error destroying builder artifact: reading body msgpack decode error [pos 1102]: reflect.Set: value of type map[interface {}]interface {} is not assignable to type error; bad artifact: []string(nil)
==> Builds finished but no artifacts were created.
@MichaelSweikata
Copy link
Author

Also it appears you might have an issue in your bug toolkit?

https://github.com/hashicorp/packer/actions/runs/943873510

@SwampDragons
Copy link
Contributor

Hi, thanks for reaching out! This is probably not critical; the bug being reported is that the builder wasn't able to clean up the intermediary builder artifact after running the post-processor. We'll take a look when we get a chance.

I'm curious, what's your use-case for using the vsphere post-processor with the vsphere-clone builder? Moving it to a different host?

@MichaelSweikata
Copy link
Author

Hi @SwampDragons , sorry for the delay on response. My use-case for this post-process use is to take an existing base template of my image, clone it, configure it, and then push it up to vSphere as an ovf to enable access to the vapp parameters. I'm trying to get the host set up to utilize cloud-init.

@SwampDragons
Copy link
Contributor

Interesting, thanks for sharing!

@tenthirtyam
Copy link
Contributor

Please transfer to hashicorp/packer-plugin-vsphere.

cc @nywilken

@tenthirtyam
Copy link
Contributor

Duplicate of hashicorp/packer-plugin-vsphere#279

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants