@@ -6,7 +6,6 @@ package simulator
66
77import (
88 "fmt"
9- "net/url"
109 "os"
1110 "path"
1211
@@ -180,6 +179,7 @@ func (v *VirtualMachineSnapshot) ExportSnapshot(ctx *Context, req *types.ExportS
180179 device := object .VirtualDeviceList (v .Config .Hardware .Device )
181180 ndevice := make (map [string ]int )
182181 var urls []types.HttpNfcLeaseDeviceUrl
182+ u := leaseURL (ctx )
183183
184184 for _ , d := range device {
185185 info , ok := d .GetVirtualDevice ().Backing .(types.BaseVirtualDeviceFileBackingInfo )
@@ -197,14 +197,11 @@ func (v *VirtualMachineSnapshot) ExportSnapshot(ctx *Context, req *types.ExportS
197197 n := ndevice [kind ]
198198 ndevice [kind ]++
199199
200+ u .Path = nfcPrefix + path .Join (lease .Reference ().Value , name )
200201 urls = append (urls , types.HttpNfcLeaseDeviceUrl {
201- Key : fmt .Sprintf ("/%s/%s:%d" , vm .Self .Value , kind , n ),
202- ImportKey : fmt .Sprintf ("/%s/%s:%d" , vm .Name , kind , n ),
203- Url : (& url.URL {
204- Scheme : "https" ,
205- Host : "*" ,
206- Path : nfcPrefix + path .Join (lease .Reference ().Value , name ),
207- }).String (),
202+ Key : fmt .Sprintf ("/%s/%s:%d" , vm .Self .Value , kind , n ),
203+ ImportKey : fmt .Sprintf ("/%s/%s:%d" , vm .Name , kind , n ),
204+ Url : u .String (),
208205 SslThumbprint : "" ,
209206 Disk : types .NewBool (disk ),
210207 TargetId : name ,
0 commit comments