diff --git a/tools/infrakit.hyperkit/README.md b/tools/infrakit.hyperkit/README.md index 47fa3fbc0..7f677905f 100644 --- a/tools/infrakit.hyperkit/README.md +++ b/tools/infrakit.hyperkit/README.md @@ -9,10 +9,6 @@ each instance keeps some state in a sub-directory. The VM state directory can be specified at the kernel command line using the `--vm-dir` option. -The plugin also needs to know where the kernel and `initrd` images are -located. The `--vm-lib` command line argument to the plugin specifies -the directory. Inside the VM library directory every kernel/initrd configuration should be stored in a sub-directory. The sub-directory name is used in the instance configuration. - ## Building ```sh diff --git a/tools/infrakit.hyperkit/cmd/instance.go b/tools/infrakit.hyperkit/cmd/instance.go index b9b2062b3..019cce87a 100644 --- a/tools/infrakit.hyperkit/cmd/instance.go +++ b/tools/infrakit.hyperkit/cmd/instance.go @@ -20,9 +20,8 @@ import ( ) // NewHyperKitPlugin creates an instance plugin for hyperkit. -func NewHyperKitPlugin(vmLib, vmDir, hyperkit, vpnkitSock string, thyper, tkern *template.Template) instance.Plugin { - return &hyperkitPlugin{VMLib: vmLib, - VMDir: vmDir, +func NewHyperKitPlugin(vmDir, hyperkit, vpnkitSock string, thyper, tkern *template.Template) instance.Plugin { + return &hyperkitPlugin{VMDir: vmDir, HyperKit: hyperkit, VPNKitSock: vpnkitSock, @@ -32,10 +31,6 @@ func NewHyperKitPlugin(vmLib, vmDir, hyperkit, vpnkitSock string, thyper, tkern } type hyperkitPlugin struct { - // VMLib is the path to a directory where each sub-directory - // contains a vmlinuz and a initrd image - VMLib string - // VMDir is the path to a directory where per VM state is kept VMDir string @@ -91,7 +86,6 @@ func (v hyperkitPlugin) Provision(spec instance.Spec) (*instance.ID, error) { // Apply parameters params := map[string]interface{}{ "VMLocation": instanceDir, - "VMLib": v.VMLib, "VPNKitSock": v.VPNKitSock, "Properties": properties, } @@ -250,8 +244,8 @@ const hyperkitArgs = "-A -u -F {{.VMLocation}}/hyperkit.pid " + "-s 2:0,virtio-vpnkit,path={{.VPNKitSock}} " + "-l com1,autopty={{.VMLocation}}/tty,log={{.VMLocation}}/console-ring" const hyperkitKernArgs = "kexec," + - "{{.VMLib}}/{{.Properties.Moby}}/vmlinuz64," + - "{{.VMLib}}/{{.Properties.Moby}}/initrd.img," + + "{{.Properties.Moby}}/vmlinuz64," + + "{{.Properties.Moby}}/initrd.img," + "earlyprintk=serial console=ttyS0 panic=1 vsyscall=emulate page_poison=1 ntp=gateway" func (v hyperkitPlugin) execHyperKit(params map[string]interface{}) error { diff --git a/tools/infrakit.hyperkit/cmd/main.go b/tools/infrakit.hyperkit/cmd/main.go index 4dd4edc55..1099897e9 100644 --- a/tools/infrakit.hyperkit/cmd/main.go +++ b/tools/infrakit.hyperkit/cmd/main.go @@ -52,7 +52,6 @@ func main() { name := cmd.Flags().String("name", "instance-hyperkit", "Plugin name to advertise for discovery") logLevel := cmd.Flags().Int("log", cli.DefaultLogLevel, "Logging level. 0 is least verbose. Max is 5") - vmLib := cmd.Flags().String("vm-lib", "", "Directory with subdirectories of kernels/initrds combinations") vmDir := cmd.Flags().String("vm-dir", defaultVMDir, "Directory where to store VM state") hyperkit := cmd.Flags().String("hyperkit", defaultHyperKit, "Path to HyperKit executable") @@ -73,7 +72,7 @@ func main() { cli.SetLogLevel(*logLevel) cli.RunPlugin(*name, - instance_plugin.PluginServer(NewHyperKitPlugin(*vmLib, *vmDir, *hyperkit, *vpnkitSock, thyper, tkern)), + instance_plugin.PluginServer(NewHyperKitPlugin(*vmDir, *hyperkit, *vpnkitSock, thyper, tkern)), metadata_plugin.PluginServer(metadata.NewPluginFromData( map[string]interface{}{ "version": Version, diff --git a/tools/infrakit.hyperkit/hyperkit.json b/tools/infrakit.hyperkit/hyperkit.json index 4782e76a9..73921aa74 100644 --- a/tools/infrakit.hyperkit/hyperkit.json +++ b/tools/infrakit.hyperkit/hyperkit.json @@ -7,7 +7,7 @@ "Instance": { "Plugin": "instance-hyperkit", "Properties": { - "Moby": "default", + "Moby": "./vms/default", "Disk" : 512, "CPUs" : 2, "Memory" : 1024