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
c072a56b
Commit
c072a56b
authored
Jul 01, 2013
by
Steven Merrill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish initial compaction feature.
parent
3b49f7bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
7 deletions
+5
-7
builder/vmware/driver.go
builder/vmware/driver.go
+4
-4
builder/vmware/step_compact_disk.go
builder/vmware/step_compact_disk.go
+1
-2
builder/vmware/step_create_disk.go
builder/vmware/step_create_disk.go
+0
-1
No files found.
builder/vmware/driver.go
View file @
c072a56b
...
@@ -44,13 +44,13 @@ type Fusion5Driver struct {
...
@@ -44,13 +44,13 @@ type Fusion5Driver struct {
}
}
func
(
d
*
Fusion5Driver
)
CompactDisk
(
diskPath
string
)
error
{
func
(
d
*
Fusion5Driver
)
CompactDisk
(
diskPath
string
)
error
{
c
md
:=
exec
.
Command
(
d
.
vdiskManagerPath
(),
"-d"
,
diskPath
)
defragC
md
:=
exec
.
Command
(
d
.
vdiskManagerPath
(),
"-d"
,
diskPath
)
if
_
,
_
,
err
:=
d
.
runAndLog
(
c
md
);
err
!=
nil
{
if
_
,
_
,
err
:=
d
.
runAndLog
(
defragC
md
);
err
!=
nil
{
return
err
return
err
}
}
c
md
:=
exec
.
Command
(
d
.
vdiskManagerPath
(),
"-k"
,
diskPath
)
shrinkC
md
:=
exec
.
Command
(
d
.
vdiskManagerPath
(),
"-k"
,
diskPath
)
if
_
,
_
,
err
:=
d
.
runAndLog
(
c
md
);
err
!=
nil
{
if
_
,
_
,
err
:=
d
.
runAndLog
(
shrinkC
md
);
err
!=
nil
{
return
err
return
err
}
}
...
...
builder/vmware/step_compact_disk.go
View file @
c072a56b
...
@@ -4,7 +4,6 @@ import (
...
@@ -4,7 +4,6 @@ import (
"fmt"
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/packer"
"path/filepath"
)
)
// This step compacts the virtual disks for the VM.
// This step compacts the virtual disks for the VM.
...
@@ -24,7 +23,7 @@ func (stepCompactDisk) Run(state map[string]interface{}) multistep.StepAction {
...
@@ -24,7 +23,7 @@ func (stepCompactDisk) Run(state map[string]interface{}) multistep.StepAction {
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
:=
state
[
"ui"
]
.
(
packer
.
Ui
)
ui
.
Say
(
"Compacting the disk image"
)
ui
.
Say
(
"Compacting the disk image"
)
if
err
:=
driver
.
CompactDisk
(
config
.
FullDiskPath
,
fmt
.
Sprintf
(
"%dM"
,
config
.
DiskSize
)
);
err
!=
nil
{
if
err
:=
driver
.
CompactDisk
(
config
.
FullDiskPath
);
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error compacting disk: %s"
,
err
)
err
:=
fmt
.
Errorf
(
"Error compacting disk: %s"
,
err
)
state
[
"error"
]
=
err
state
[
"error"
]
=
err
ui
.
Error
(
err
.
Error
())
ui
.
Error
(
err
.
Error
())
...
...
builder/vmware/step_create_disk.go
View file @
c072a56b
...
@@ -4,7 +4,6 @@ import (
...
@@ -4,7 +4,6 @@ import (
"fmt"
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/packer"
"path/filepath"
)
)
// This step creates the virtual disks for the VM.
// This step creates the virtual disks for the VM.
...
...
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