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
fe37d9b6
Commit
fe37d9b6
authored
Aug 08, 2014
by
Rickard von Essen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parallels-iso: ISO not removed from VM after install [GH-1338]
Also remove floppy and prl-tools ISO if applicable.
parent
104bd9d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
5 deletions
+57
-5
builder/parallels/common/step_attach_floppy.go
builder/parallels/common/step_attach_floppy.go
+16
-2
builder/parallels/common/step_attach_parallels_tools.go
builder/parallels/common/step_attach_parallels_tools.go
+21
-2
builder/parallels/iso/step_attach_iso.go
builder/parallels/iso/step_attach_iso.go
+20
-1
No files found.
builder/parallels/common/step_attach_floppy.go
View file @
fe37d9b6
...
...
@@ -44,7 +44,7 @@ func (s *StepAttachFloppy) Run(state multistep.StateBag) multistep.StepAction {
}
ui
.
Say
(
"Attaching floppy disk..."
)
//
Create the floppy disk controller
//
Attaching the floppy disk
add_command
:=
[]
string
{
"set"
,
vmName
,
"--device-add"
,
"fdd"
,
...
...
@@ -62,4 +62,18 @@ func (s *StepAttachFloppy) Run(state multistep.StateBag) multistep.StepAction {
return
multistep
.
ActionContinue
}
func
(
s
*
StepAttachFloppy
)
Cleanup
(
state
multistep
.
StateBag
)
{}
func
(
s
*
StepAttachFloppy
)
Cleanup
(
state
multistep
.
StateBag
)
{
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
if
s
.
floppyPath
==
""
{
return
}
log
.
Println
(
"Detaching floppy disk..."
)
command
:=
[]
string
{
"set"
,
vmName
,
"--device-del"
,
"fdd0"
,
}
driver
.
Prlctl
(
command
...
)
}
builder/parallels/common/step_attach_parallels_tools.go
View file @
fe37d9b6
...
...
@@ -34,7 +34,7 @@ func (s *StepAttachParallelsTools) Run(state multistep.StateBag) multistep.StepA
}
// Attach the guest additions to the computer
log
.
Println
(
"Attaching Parallels Tools ISO onto IDE controller..."
)
ui
.
Say
(
"Attaching Parallels Tools ISO onto IDE controller..."
)
command
:=
[]
string
{
"set"
,
vmName
,
"--device-add"
,
"cdrom"
,
...
...
@@ -53,4 +53,23 @@ func (s *StepAttachParallelsTools) Run(state multistep.StateBag) multistep.StepA
return
multistep
.
ActionContinue
}
func
(
s
*
StepAttachParallelsTools
)
Cleanup
(
state
multistep
.
StateBag
)
{}
func
(
s
*
StepAttachParallelsTools
)
Cleanup
(
state
multistep
.
StateBag
)
{
if
_
,
ok
:=
state
.
GetOk
(
"attachedToolsIso"
);
!
ok
{
return
}
driver
:=
state
.
Get
(
"driver"
)
.
(
Driver
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
log
.
Println
(
"Detaching Parallels Tools ISO..."
)
cdDevice
:=
"cdrom0"
if
_
,
ok
:=
state
.
GetOk
(
"attachedIso"
);
ok
{
cdDevice
=
"cdrom1"
}
command
:=
[]
string
{
"set"
,
vmName
,
"--device-del"
,
cdDevice
,
}
driver
.
Prlctl
(
command
...
)
}
builder/parallels/iso/step_attach_iso.go
View file @
fe37d9b6
...
...
@@ -5,6 +5,7 @@ import (
"github.com/mitchellh/multistep"
parallelscommon
"github.com/mitchellh/packer/builder/parallels/common"
"github.com/mitchellh/packer/packer"
"log"
)
// This step attaches the ISO to the virtual machine.
...
...
@@ -23,6 +24,7 @@ func (s *stepAttachISO) Run(state multistep.StateBag) multistep.StepAction {
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
// Attach the disk to the controller
ui
.
Say
(
"Attaching ISO onto IDE controller..."
)
command
:=
[]
string
{
"set"
,
vmName
,
"--device-set"
,
"cdrom0"
,
...
...
@@ -42,4 +44,21 @@ func (s *stepAttachISO) Run(state multistep.StateBag) multistep.StepAction {
return
multistep
.
ActionContinue
}
func
(
s
*
stepAttachISO
)
Cleanup
(
state
multistep
.
StateBag
)
{}
func
(
s
*
stepAttachISO
)
Cleanup
(
state
multistep
.
StateBag
)
{
if
_
,
ok
:=
state
.
GetOk
(
"attachedIso"
);
!
ok
{
return
}
driver
:=
state
.
Get
(
"driver"
)
.
(
parallelscommon
.
Driver
)
vmName
:=
state
.
Get
(
"vmName"
)
.
(
string
)
command
:=
[]
string
{
"set"
,
vmName
,
"--device-set"
,
"cdrom0"
,
"--enable"
,
"--disconnect"
,
}
// Remove the ISO, ignore errors
log
.
Println
(
"Detaching ISO..."
)
driver
.
Prlctl
(
command
...
)
}
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