Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
58daa1d8
Commit
58daa1d8
authored
Jul 02, 2013
by
Steven Merrill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a 'skip_compaction' step.
parent
af5721c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
builder/vmware/builder.go
builder/vmware/builder.go
+1
-0
builder/vmware/step_compact_disk.go
builder/vmware/step_compact_disk.go
+10
-1
No files found.
builder/vmware/builder.go
View file @
58daa1d8
...
...
@@ -39,6 +39,7 @@ type config struct {
HTTPPortMax
uint
`mapstructure:"http_port_max"`
BootCommand
[]
string
`mapstructure:"boot_command"`
BootWait
time
.
Duration
``
SkipCompaction
bool
`mapstructure:"skip_compaction"`
ShutdownCommand
string
`mapstructure:"shutdown_command"`
ShutdownTimeout
time
.
Duration
``
SSHUser
string
`mapstructure:"ssh_username"`
...
...
builder/vmware/step_compact_disk.go
View file @
58daa1d8
...
...
@@ -4,11 +4,14 @@ import (
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"log"
)
// This step compacts the virtual disk for the VM.
// This step compacts the virtual disk for the VM unless the "skip_compaction"
// boolean is true.
//
// Uses:
// config *config
// driver Driver
// full_disk_path string
// ui packer.Ui
...
...
@@ -18,10 +21,16 @@ import (
type
stepCompactDisk
struct
{}
func
(
stepCompactDisk
)
Run
(
state
map
[
string
]
interface
{})
multistep
.
StepAction
{
config
:=
state
[
"config"
]
.
(
*
config
)
driver
:=
state
[
"driver"
]
.
(
Driver
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
full_disk_path
:=
state
[
"full_disk_path"
]
.
(
string
)
if
config
.
SkipCompaction
==
true
{
log
.
Println
(
"Skipping disk compaction step..."
)
return
multistep
.
ActionContinue
}
ui
.
Say
(
"Compacting the disk image"
)
if
err
:=
driver
.
CompactDisk
(
full_disk_path
);
err
!=
nil
{
state
[
"error"
]
=
fmt
.
Errorf
(
"Error compacting disk: %s"
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment