vmware-archive / vcd-cli

Command Line Interface for VMware vCloud Director
https://vmware.github.io/vcd-cli
Other
165 stars 105 forks source link

vcd vapp add-vm powers on vApp #516

Open JamesTimms opened 4 years ago

JamesTimms commented 4 years ago

I'm using vCD 9.1 and I've found that there is no way to use vcd vapp add-vm without the vApp being powered on. I've tracked it down to the lack of options in a two specific functions.

Is there any reason for not having an option to keep the vApp powered off? Why is the default behavior to power the vApp on?

In ./lib/python3.6/site-packages/vcd_cli/vapp.py there is the add_vm function;

def add_vm(ctx, name, source_vapp, source_vm, catalog, target_vm, hostname,
           network, ip_allocation_mode, storage_profile, password_auto,
           accept_all_eulas):

In that function it calls a pyvcloud function called add_vms; task = vapp.add_vms([spec], all_eulas_accepted=accept_all_eulas)

If I replace this function in my local install with the below I get the desired behavior; task = vapp.add_vms([spec], deploy=False, power_on=False, all_eulas_accepted=accept_all_eulas)

The pyvcloud function is defined as such;

    def add_vms(self,
                specs,
                deploy=True,
                power_on=True,
                all_eulas_accepted=None,
                source_delete=False):

Any reason there isn't an option for deploy or power_on status?

Thanks, James

JamesTimms commented 4 years ago

Any chance of reviewing this? Would you accept a pull request if I added options to change this functionality?

biyiklioglu commented 4 years ago

I agree with that. Since there is no option to modify hardware configuration of the VM while deploying I would prefer to have it powered off, so I can modify and power on it manually.

dtrinf commented 2 years ago

Any update? There is a issue related from four years now https://github.com/vmware/vcd-cli/issues/193