Skip to content

Commit

Permalink
Merge pull request #94 from AtaxyaNetwork/main
Browse files Browse the repository at this point in the history
Allow user to have a template or a full VM
  • Loading branch information
ddelnano authored Sep 26, 2023
2 parents 6af6320 + a9e5f30 commit 9d57d14
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions builder/xenserver/common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type Config struct {
SourcePath string `mapstructure:"source_path"`

Firmware string `mapstructure:"firmware"`
SkipSetTemplate bool `mapstructure:"skip_set_template"`

ctx interpolate.Context
}
Expand Down
2 changes: 2 additions & 0 deletions builder/xenserver/common/config.hcl2spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions builder/xenserver/iso/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,14 @@ func (self *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (p
},
new(commonsteps.StepProvision),
new(xscommon.StepShutdown),
new(xscommon.StepSetVmToTemplate),
}

if !self.config.SkipSetTemplate {
steps = append(steps,
new(xscommon.StepSetVmToTemplate))
}

steps = append(steps,
&xscommon.StepDetachVdi{
VdiUuidKey: "iso_vdi_uuid",
},
Expand All @@ -299,8 +306,7 @@ func (self *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (p
&xscommon.StepDetachVdi{
VdiUuidKey: "floppy_vdi_uuid",
},
new(xscommon.StepExport),
}
new(xscommon.StepExport))

if self.config.ISOName == "" {
steps = append(download_steps, steps...)
Expand Down
3 changes: 3 additions & 0 deletions docs/builders/iso/xenserver-iso.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ each category, the available options are alphabetized and described.
regardless of success. "on_success" requests that the VM only be cleaned up if an
artifact was produced. The latter is useful for debugging templates that fail.

* `skip_set_template` (bool) - If you want to get the full XVA, to be able to import directly the VM
instead of using the output template, you can set that to True

* `network_names` (array of strings) - A list of networks identified by their name label which
will be used for the VM during creation. The first network will correspond to the VM's
first network interface (VIF), the second will corespond to the second VIF and so on.
Expand Down

0 comments on commit 9d57d14

Please sign in to comment.