Skip to content

Commit 9d57d14

Browse files
authored
Merge pull request #94 from AtaxyaNetwork/main
Allow user to have a template or a full VM
2 parents 6af6320 + a9e5f30 commit 9d57d14

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

builder/xenserver/common/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ type Config struct {
3434
SourcePath string `mapstructure:"source_path"`
3535

3636
Firmware string `mapstructure:"firmware"`
37+
SkipSetTemplate bool `mapstructure:"skip_set_template"`
3738

3839
ctx interpolate.Context
3940
}

builder/xenserver/common/config.hcl2spec.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

builder/xenserver/iso/builder.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,14 @@ func (self *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (p
286286
},
287287
new(commonsteps.StepProvision),
288288
new(xscommon.StepShutdown),
289-
new(xscommon.StepSetVmToTemplate),
289+
}
290+
291+
if !self.config.SkipSetTemplate {
292+
steps = append(steps,
293+
new(xscommon.StepSetVmToTemplate))
294+
}
295+
296+
steps = append(steps,
290297
&xscommon.StepDetachVdi{
291298
VdiUuidKey: "iso_vdi_uuid",
292299
},
@@ -299,8 +306,7 @@ func (self *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (p
299306
&xscommon.StepDetachVdi{
300307
VdiUuidKey: "floppy_vdi_uuid",
301308
},
302-
new(xscommon.StepExport),
303-
}
309+
new(xscommon.StepExport))
304310

305311
if self.config.ISOName == "" {
306312
steps = append(download_steps, steps...)

docs/builders/iso/xenserver-iso.html.markdown

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ each category, the available options are alphabetized and described.
143143
regardless of success. "on_success" requests that the VM only be cleaned up if an
144144
artifact was produced. The latter is useful for debugging templates that fail.
145145

146+
* `skip_set_template` (bool) - If you want to get the full XVA, to be able to import directly the VM
147+
instead of using the output template, you can set that to True
148+
146149
* `network_names` (array of strings) - A list of networks identified by their name label which
147150
will be used for the VM during creation. The first network will correspond to the VM's
148151
first network interface (VIF), the second will corespond to the second VIF and so on.

0 commit comments

Comments
 (0)