Operating System - HP-UX
1748226 Members
4473 Online
108759 Solutions
New Discussion юеВ

Re: Set primary boot for a VM without starting the VM

 

Set primary boot for a VM without starting the VM

Hi,

I create new VMs by cloning a master VM's LUN on storage, discover this LUN on the VMhost, create the new VM on VMhost and then boot it.

When I boot the VM for the very first time it stops at EFI shell because there is no primary boot path set.

To automate the process of creating new VMs it would be nice to set the primary boot path for a VM without having to start the VM (and having to select the boot-device manually in EFI and then execute setboot when hpux is started).

Is there a way to do this?

Thanks in advance
Walter
6 REPLIES 6
Mounaam
Trusted Contributor

Re: Set primary boot for a VM without starting the VM

I you use command hpvmclone to create a new virtual machine you can specify boot device with "-b".

Re: Set primary boot for a VM without starting the VM

Thanks for this hint.

hpvmclone -b manpage says: "The virtual device hardware address specifies the address of the boot disk being cloned from. The physical device specifies the boot disk being cloned to."
The cloning chapter 3.6 in VM admin guide says: "Use the -b option to specify a storage device to be physically duplicated in the cloning process."

If I understand this right, then hpvmclone will copy data from the "virtual device hardware" to the "physical device". But this is not what I want. I need no copy of the original VMs disk because disk cloning is already done on the storage system.

Do I mistake something?

Anonymous
Not applicable

Re: Set primary boot for a VM without starting the VM

HPVM V4.2.5 comes with hpvmnvram command (documented in the upcoming release) which allows to modify guest's NVRAM, i.e. to adjust boot manager setup.

You could try something like:
# hpvmnvram -P guest3 -a /dev/rdisk/disk7

where disk7 is the guest's boot device (as seen on the host).

Stan

Re: Set primary boot for a VM without starting the VM

Thanks for this hint.

Version 4.2 already has a hpvmnvram command. But there is no man-page nor any documentation delivered.

Executing the command gives a little help:
usage: hpvmnvram {-P vm_name | -p vm_number | -f filename}
{ -l [-b filename] | -s guid:name:filename [-Q] |
-t guid:name [-b filename] | -r guid:name [-Q]}

Does any body know if this command can be used to set the boot path for the vm?

And another question: Response on this thread is is not as much as I'm hoping. Why? Am I the very first one trying this? Is this a totally unusual thing to do? Are there other/better ways to clone a existing VM?

Thanks!
Walter
Anonymous
Not applicable

Re: Set primary boot for a VM without starting the VM

Well, the hpvmnvram command on pre-V4.3
is of limited functionality and doesn't allow to simply change what you need.

I took the piece from V4.3 man pages.
You'd have to wait for HPVM V4.3.
AnthonySN
Respected Contributor

Re: Set primary boot for a VM without starting the VM

we faced this problem.
workaround is to clone the vm config by hpvmclone command
hpvmclone -P test1 -N test2
check the boot disk of test2 using
hpvmstatus -P test2
then delete the boot disk using hpvmmodify
hpvmmodify -P test1 -d disk:scsi::disk:/dev/rdsk/c?d?t?(found in the above command)

and again add the cloned boot disk using the hpvmmodify command.
hpvmmodify -P test1 -a disk:scsi::disk:/dev/rdsk/c?d?t?(cloneddisk)

hpvmstart -P test2
then your new vm will boot automatically without stopping at efi