weixin_39668282
weixin_39668282
2020-12-28 11:11

Is it possible to storage vMotion a VM after creation?

Hello,

This is more of a question than an issue. I'm able to clone an existing VM and get my build together flawlessly (thanks, nice piece of software you guys built here). Part of my finalization is to zero out the disk and then punch zeroes to shrink/reclaim free space on the LUN. After zeroing the disk I need to storage vMotion the VM to a different datastore. Is there someway to do this using an existing builder? I'd like to get away from my power CLI scripts and just do it all through Jenkins and Packer.

Thanks!

该提问来源于开源项目:jetbrains-infra/packer-builder-vsphere

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

7条回答

  • weixin_39740346 weixin_39740346 4月前

    This sounds like ami_regions parameter - a kind of postprocessing action.

    I welcome a PR for this.

    点赞 评论 复制链接分享
  • weixin_39824529 weixin_39824529 4月前

    So you're only looking to vMotion it to a different datastore and not a complete move to a new datastore and host? If you're looking to move instead of copying why not target the different datastore in the first place? Thought of something similar for my use case (copying the template to multiple datacenters [in order to reduce time of bootstrapping VMs, else it needs to copy the template across dc's via esx host's]) but in my case starting multiple packers in parallel should be sufficient.

    点赞 评论 复制链接分享
  • weixin_39740346 weixin_39740346 4月前

    Parallel builds would work, and will be even faster, but they generate more traffic and workload on external repos, and don’t guarantee the resulted VMs are identical. I also have cases, where it becomes important.

    Another reason mentioned above - data store space cleanup. Thin disks are downsized in time of moving between different datastores.

    点赞 评论 复制链接分享
  • weixin_39668282 weixin_39668282 4月前

    Yes in this case we need to move it to a different datastore with a different block size in order to reclaim the free space from a thin-provisioned disk.

    点赞 评论 复制链接分享
  • weixin_39824529 weixin_39824529 4月前

    Understood, was wondering whether moving/relocating and not copying really was the intention (as is the case in ami_regions if I understand it right).

    Since vMotion also supports moving to a new host in the same step, do you want to support this as well? Would probably make the user input a bit different or introduce another complementary param.

    点赞 评论 复制链接分享
  • weixin_39740346 weixin_39740346 4月前

    Good point. Copying and moving are two separate features

    点赞 评论 复制链接分享
  • weixin_39742065 weixin_39742065 4月前

    If jetbrains is now contributing to the main packer repo, could this ticket be moved over there?

    点赞 评论 复制链接分享

相关推荐