microsoft / packer-hyperv

Hyperv plugin for Packer.io
Other
82 stars 33 forks source link

Vagrant up throws exception for the box file created through Packer #8

Closed umavinoth closed 10 years ago

umavinoth commented 10 years ago

Repo Steps:

  1. Execute packer build for following template { "variables": { "installers_destination_folder": "C:/PackerDistr", "product_key": "", "example_dir": "C:/packer-example/V3/example" },
"builders": 
[
    {
        "type": "hyperv-iso",
        "guest_os_type":"WindowsServer2012R2Datacenter",
        "product_key" : "{{user `product_key`}}",
        "iso_url":"D:/Windows2012R2/Windows Server 2012 R2/Windows_Server_2012_R2-Datacenter_Edition–EN-US-X64.ISO",
        "disk_size_gb":40,
        "ram_size_mb":512,
        "wait_time_minutes": "10"
    }
],

"provisioners": 
[
    {
        "type": "powershell",
        "distr_src_path": "{{user `example_dir`}}/srcFolder",
        "distr_dst_dir_path": "{{user `installers_destination_folder`}}",
        "inline": 
        [
            "Write-Host 'Starting inline script...'", 
            "Write-Host 'Installing notepad...'", 
            "Start-Process '{{user `installers_destination_folder`}}/npp.6.6.3.Installer.exe' -NoNewWindow -Wait -Argument '/S'",
            "Write-Host 'Installing Mozilla Firefox...'",
            "Start-Process '{{user `installers_destination_folder`}}/Firefox Setup 30.0.exe' -NoNewWindow -Wait -Argument '/S'",
            "Write-Host 'Add Role...'", 
            "Start-Process Add-WindowsFeature Application-Server,Hyper-V,WAS '/S'",
            "Write-Host 'Inline script finished!'" 
        ],
        "script_path": "{{user `example_dir`}}/probe.ps1"
    }
],
"post-processors": 
[
    {
        "type": "vagrant",
        "compression_level": 1
    }
]

}

Expected Result:

  1. Should create a box file
  2. Using this box file in Vagrantfile and doing a vagrant up command should create a new vm in hyper-v.

Actual Result:

  1. Box file creation is successful.
  2. Using the same box file in vagrant to manage vm with Vagrant throws exception. image
babumuralidharan commented 10 years ago

@v-vlshch ,To add on the above, would like to know why the parameter vm_name was removed from the config ? I guess that change is causing the above problem in changing the format in which the box file being created and the same box file when used is throwing the above exception

babumuralidharan commented 10 years ago

This issue fix has been verified with the latest build and the box file is created as per vagrant format for hyperv. Closing this issue.