0
I created an ubuntu linux image with packer. ( packer.io) Here is a slice from the .json
"os_type": "Linux",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "16.04-LTS",
After I created a linux vm based on the vhd which created with packer I can not log-in with ssh. I always get a Public key error message. So, I have no public key because I don't know which shall I use??! Are ther any defaule public key inside? Or get it from somewhere?
Hello Jason.Thank you for the suggestion.I would use this .vhd via Terraform. So I would create a vm via TF. – GergA – 2017-11-20T18:14:53.967
@GergA Could you please show your TF template, maybe we can find password there. By the way, if you can't find the password. we can via azure portal to reset the password. If my answer helps, please don't forget to accept it as an answer, thanks:) – Jason Ye – 2017-11-21T01:35:18.200
Ye. I will not forget to rate the answer :-). Here is my TF Template. https://pastebin.com/xerqUZq0 the only way is to inject my ssh key is if I star to work from Azure image like here: https://pastebin.com/Qcr4tAFX With packer-created image the os_profile option doesn't work
– GergA – 2017-11-21T09:16:13.733@GergA I can't find anything about user account and password, by default, the packer create VHD, user name is
packer
, please try to use Azure portal to reset the password. – Jason Ye – 2017-11-21T09:22:04.017I not 100% understand what you want. I need a vhd image what made by Packer and I can join to that with my username/password. I have no chance to reset the password on the created VM via Azure. Unfortunately the deplorvision phase in the end of Packer build remove the packer user. – GergA – 2017-11-21T12:06:21.430
@GergA we should add
– Jason Ye – 2017-11-22T01:50:42.957os_profile
to TF json file,not packer. More information please refer to this link.I know that. Please check my second pastebin: https://pastebin.com/Qcr4tAFX .Didn't worked
– GergA – 2017-11-22T08:52:05.523@GergA Do you have the private key? when try ssh to this VM and specify this private key, does that work? – Jason Ye – 2017-11-22T08:54:25.973
with os_profile I get the following error: Status=400 Code="InvalidParameter" Message="Cannot specify user image overrides for a disk already defined in the specified image reference." – GergA – 2017-11-22T09:10:34.370
Let us continue this discussion in chat.
– Jason Ye – 2017-11-22T09:12:40.860I start to make a managed_image with Packer and now I can create a VM with terraform from that. Thanks for Jason – GergA – 2017-11-22T15:26:15.777