Is there any ways to access files/ folders from external source/ server during Packer build (Azure)?

36 views
Skip to first unread message

Sim

unread,
Mar 19, 2018, 8:48:35 PM3/19/18
to Packer
As I want to access some large installation files during the build process to install some applications to the image, just wondering if there are any ways to access those files during Packer build either access Azure storage files or somewhere?? The usual way would be to transfer files to Packer, but I don't think this will work as the files are too large (>8Gb) to be transferred via winrm. 

Thanks.


Alvaro Miranda Aguilera

unread,
Mar 20, 2018, 3:04:02 AM3/20/18
to packe...@googlegroups.com
If WinRM is slow or unreliable, then The best is to run some script or command inside the guest and download them as your would do in a normal server.

Alvaro.

On Tue, Mar 20, 2018 at 1:48 AM, Sim <nghia.l...@gmail.com> wrote:
As I want to access some large installation files during the build process to install some applications to the image, just wondering if there are any ways to access those files during Packer build either access Azure storage files or somewhere?? The usual way would be to transfer files to Packer, but I don't think this will work as the files are too large (>8Gb) to be transferred via winrm. 

Thanks.


--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/86619cd9-b169-4ec6-a562-61c0093fedde%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Sim

unread,
Mar 25, 2018, 8:44:17 AM3/25/18
to Packer
I have added some variables in Packer Azure template so that the temporary VM could be added to the Azure virtual network group, so it can reach other servers in our internal network. However, it still could not access the server's resources (it could ping them with IP addresses) even after being added to the domain by the scripting to be run during packer build. I found out that it was probably because the local admin user of that temporary VM was not in the AD and couldn't access other servers to get the resources (technical credentials of AD user will be asked to enter to be able to get access). So, just wondering is there any other ways that we could log Packer as our AD user in the temporary VM during the build to avoid this kind of access permission issues? 

Thank you  

Alvaro Miranda Aguilera

unread,
Mar 26, 2018, 3:11:32 AM3/26/18
to packe...@googlegroups.com
Same as you weren't using packer.

If this is windows try "run as" as part of the script.

Or use user/pass authentication on the remote resource.

Alvaro.

On Sun, Mar 25, 2018 at 2:44 PM, Sim <nghia.l...@gmail.com> wrote:
I have added some variables in Packer Azure template so that the temporary VM could be added to the Azure virtual network group, so it can reach other servers in our internal network. However, it still could not access the server's resources (it could ping them with IP addresses) even after being added to the domain by the scripting to be run during packer build. I found out that it was probably because the local admin user of that temporary VM was not in the AD and couldn't access other servers to get the resources (technical credentials of AD user will be asked to enter to be able to get access). So, just wondering is there any other ways that we could log Packer as our AD user in the temporary VM during the build to avoid this kind of access permission issues? 

Thank you  

--
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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Message has been deleted

Alvaro Miranda Aguilera

unread,
Mar 30, 2018, 6:06:33 AM3/30/18
to packe...@googlegroups.com
Hello

There is no way to change the user that packer uses.


my suggestion was


connect with the normal user
run the join network 
reboot

then as the normal user, using runas run a 2nd script as the domain user you require.

Alvaro


On Mon, Mar 26, 2018 at 1:58 PM, Sim <nghia.l...@gmail.com> wrote:
I think you might misunderstand the problem. I was running Packer on windows, the temporary vm generated by packer during the build process created its own run-time local admin account to run a whole bunch of script and config based on what defined in the template. 
I was trying to find a way to log the local admin user of the TEMPORARY VM with domain active directory user instead of using the default local admin user which has restricted access to the domain network's resources even the VM has or hasn't been added into the domain. Hopefully, my explanation is clear enough. Thank you. 


On Monday, March 26, 2018 at 6:11:32 PM UTC+11, Alvaro Miranda Aguilera wrote:
Same as you weren't using packer.

If this is windows try "run as" as part of the script.

Or use user/pass authentication on the remote resource.

Alvaro.
On Sun, Mar 25, 2018 at 2:44 PM, Sim <nghia.l...@gmail.com> wrote:
I have added some variables in Packer Azure template so that the temporary VM could be added to the Azure virtual network group, so it can reach other servers in our internal network. However, it still could not access the server's resources (it could ping them with IP addresses) even after being added to the domain by the scripting to be run during packer build. I found out that it was probably because the local admin user of that temporary VM was not in the AD and couldn't access other servers to get the resources (technical credentials of AD user will be asked to enter to be able to get access). So, just wondering is there any other ways that we could log Packer as our AD user in the temporary VM during the build to avoid this kind of access permission issues? 

Thank you  

--
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.



--
Alvaro

--
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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Sim

unread,
Mar 31, 2018, 7:26:59 AM3/31/18
to Packer
I have done exactly what you have suggested, but I don't know why after successfully running the Domain Join script to join the network, it couldn't move on to the next step of the template (windows-restart or even executing the next script in the template). I think it may be because of the Domain join PowerShell command (Add-Computer -DomainName $domain -Credential $credential) has disconnected the VM to continue running the packer template. I have tried to look for a command or even a param to stop the VM to restart/ disconnect the VM from continuing the script, but couldn't find any. Is there any way to get over this issue? or is it a bug that packer couldn't continue the build after the tempVM has been domain joined or restarted? Thanks 
Reply all
Reply to author
Forward
0 new messages