{
"builders": [{
"type": "amazon-ebs",
"vpc_id": "vpc-****************",
"subnet_id": "subnet-****************",
"security_group_id": "sg-****************",
"region": "us-east-1",
"source_ami": "ami-client-w2016-image",
"ami_name": "2disks-from-packer-test-{{timestamp}}",
"iam_instance_profile": "****************",
"launch_block_device_mappings": [{
"device_name": "/dev/sda1",
"volume_size": 30,
"volume_type": "gp2",
"delete_on_termination": true
},
{
"device_name": "xvdb",
"volume_size": 30,
"volume_type": "gp2",
"delete_on_termination": true
}], {
"type": "powershell",
"script": "./setup_two_drive_names_c_and_s.ps1"
},# Do volume config of the two drives
write-host "Setting up drives..."
Initialize-Disk -Number 1 -PartitionStyle "MBR"
New-Partition -DiskNumber 1 -UseMaximumSize -IsActive -AssignDriveLetter
Format-Volume -DriveLetter d -Confirm:$FALSE
label c: "volume1"
label d: "volume2"
Set-Partition -DriveLetter D -NewDriveLetter S C:\ProgramData\Amazon\EC2-Windows\Launch\Config\DriveLetterMappingConfig.jsonIf you attach the volumes on boot and use the user data script to check the disks for uninitialized volumes and then initialize and format those would it accomplish the same goal?
In the past there have been some interesting quirks in Packer and Vagrant in Windows where the uploaded script file may not get updated between multiple steps, and formatting via unattend.xml or first boot/login scripts is tough to test across various providers and disk types.
If you attach the volumes on boot and use the user data script to check the disks for uninitialized volumes and then initialize and format those would it accomplish the same goal?
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/7f77bcdb-9001-4f5a-9303-6a270a3d7021%40googlegroups.com.