Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create VM from template in the Stack Create command #18

Closed
sdrose opened this issue Jul 27, 2016 · 5 comments
Closed

Create VM from template in the Stack Create command #18

sdrose opened this issue Jul 27, 2016 · 5 comments
Assignees
Labels

Comments

@sdrose
Copy link

sdrose commented Jul 27, 2016

Hello Nik!
I wanted to use your software in a new environment I am turning up. In this environment, as opposed to the previous work I did when using .ISO files for starting VMs, this time I wanted to use a personal template in my cloud account (So, create a VM, then configure/install/modify it, create a snapshot then create a template from the snapshot).

When I try and specify that template within the YML file, I can not access it. It looks like the templates are filtered on Featured and Public, and not listing templates which are Mine.

Thanks!
-dave
British Telecom; Advise/Compute team -- USA.

@niwo niwo self-assigned this Aug 4, 2016
@niwo
Copy link
Owner

niwo commented Aug 4, 2016

Hi Dave!

I'm not able reproduce the issue your are seeing.
The filter used is "executable" which should list all templates which the calling user can use to deploy a VM, including the one belonging to the caller.

Can you make sure you can list the template like this:

cloudstack-cli command listTemplates name=<template-name> templatefilter=executable

You have to make sure the calling user is the owner of the template (or the templates are shared or featured). It won't work if you execute the command as root-admin and are not the owner.

Thanks,
Nik

@sdrose
Copy link
Author

sdrose commented Aug 4, 2016

Hi Nik!
I am running the template list as the user who created or owns the template. Here are 2 different templates, shown in detail. One is mine (the Win_2012r2_Gold_Hardened) , and one is a Featured template (the IT_W2K8R2_EE_v1.0_ESXi). My template I am unable to see nor access via cloudstack-cli commands, but the second one (the featured one) I am able to access.

C:\Users\606457840>cs command listTemplates name="IT_W2K8R2_EE_v1.0_ESXi" templatefilter=executable

  • id: 376c0dfd-4484-45e1-8f20-db48a6cae13d
    name: IT_W2K8R2_EE_v1.0_ESXi
    displaytext: IT_W2K8R2_EE_v1.0_ESXi
    ispublic: true
    created: '2013-05-10T13:46:54+0000'
    isready: true
    passwordenabled: true
    format: OVA
    isfeatured: true
    crossZones: false
    ostypeid: 7835d129-ffc5-46c6-a6a3-3e8bdc6cd8dc
    ostypename: Windows Server 2008 R2 (64-bit)
    account: rwilliams
    zoneid: 42c77acf-22b9-40b3-b1d8-2aa34476bb1c
    zonename: IT-MIL-MN-G-V-A-R-S-001
    size: 42949672960
    templatetype: USER
    hypervisor: VMware
    domain: ROOT
    domainid: 371dc348-d405-4fa6-a076-5b70ecde48c4
    isextractable: false
    checksum: 8af20df0b6318979e2edce83856cd4bf
    tags: []
    sshkeyenabled: false
    isdynamicallyscalable: true

C:\Users\606457840>cs command listTemplates name="Win_2012r2_Gold_Hardened" templatefilter=executable

  • id: 0407c19d-ede1-407d-84a7-2e96ce38ec3b
    name: Win_2012r2_Gold_Hardened
    displaytext: Win_2012r2_Gold_Hardened
    ispublic: false
    created: '2016-07-22T18:02:37+0000'
    isready: true
    passwordenabled: false
    format: OVA
    isfeatured: false
    crossZones: false
    ostypeid: 3cb0e834-43d6-11e4-b12f-005056b050c9
    ostypename: Windows Server 2012 R2 (64-bit)
    account: BT_Cloud_Compute_USD_seqdvusr@bt.com
    zoneid: f236c7e1-58fa-468b-9978-247670615f24
    zonename: US-NEW-NUT-G-V-A-R-S-001
    status: Download Complete
    size: 53687091200
    templatetype: USER
    hypervisor: VMware
    domain: 1182951796-Seqirus UK Ltd
    domainid: 85be78f0-7094-4a1e-81b7-af9745cee4f8
    isextractable: false
    checksum: c5d96bfc1eaeff281fd8d2dd64e3ab79
    sourcetemplateid: eae2acbd-afa4-4167-b23f-29bb7a898d32
    details:
    memoryOvercommitRatio: '1.5'
    keyboard: US
    Message.ReservedCapacityFreed.Flag: 'false'
    dataDiskController: scsi
    cpuOvercommitRatio: '4'
    nicAdapter: Vmxnet3
    rootDiskController: ide
    tags: []
    sshkeyenabled: false
    isdynamicallyscalable: true

C:\Users\606457840>

thanks!
-dave

@niwo
Copy link
Owner

niwo commented Aug 4, 2016

Just to make sure:

  1. You can see your template with cloudstack-cli command listTemplates name="Win_2012r2_Gold_Hardened" templatefilter=executable but the command cloudstack-cli stack create ... tells you it can't find it?
  2. You are running the latest cloudstack-cli gem (1.5.5)

Thanks,
Nik

@sdrose
Copy link
Author

sdrose commented Aug 4, 2016

Ok. I used 'Template' rather than 'template' in the YAML definition file for the stack create. Using 'template' allows it to begin to process.

I was using v. 1.5.4, not 1.5.5.

However, I receive the following error:
C:\Users\606457840\cloudstack\Seqirus>cs stack create temp-test-4Aug.yml
Create stack seq_dev_dc...
Create VM test03 : job completed
Completed: 1/1 (316.0s)
Check for port forwarding rules...
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.5.5/lib/cloudstack-cli/helper.rb:173:in create_port_rules': undefined methodeach' for nil:NilClass (NoMethodError)
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.5.5/lib/cloudstack-cli/commands/stack.rb:62:in block (2 levels) in create' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.5.5/lib/cloudstack-cli/commands/stack.rb:59:ineach'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.5.5/lib/cloudstack-cli/commands/stack.rb:59:in block in create' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.5.5/lib/cloudstack-cli/commands/stack.rb:58:ineach'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.5.5/lib/cloudstack-cli/commands/stack.rb:58:in create' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:inrun'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:indispatch'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:115:in invoke' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:235:inblock in subcommand'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:instart'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.5.5/lib/cloudstack-cli/base.rb:17:in start' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.4.1/bin/cs:5:in<top (required)>'
from C:/Ruby22-x64/bin/cs:22:in load' from C:/Ruby22-x64/bin/cs:22:in

'

C:\Users\606457840\cloudstack\Seqirus>cs stack destroy temp-test-4Aug.yml
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.5.5/lib/cloudstack-cli/commands/stack.rb:93:in block (2 levels) in destroy': undefined methodinclude?' for nil:NilC
ass (NoMethodError)
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.5.5/lib/cloudstack-cli/commands/stack.rb:92:in each' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.5.5/lib/cloudstack-cli/commands/stack.rb:92:inblock in destroy'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.5.5/lib/cloudstack-cli/commands/stack.rb:91:in each' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.5.5/lib/cloudstack-cli/commands/stack.rb:91:indestroy'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:115:ininvoke'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:235:in block in subcommand' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:inrun'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in invoke_command' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:indispatch'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in start' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.5.5/lib/cloudstack-cli/base.rb:17:instart'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/cloudstack-cli-1.4.1/bin/cs:5:in <top (required)>' from C:/Ruby22-x64/bin/cs:22:inload'
from C:/Ruby22-x64/bin/cs:22:in `

'

@niwo niwo added the bug label Aug 5, 2016
@niwo
Copy link
Owner

niwo commented Aug 5, 2016

Hi Dave,

Thats ugly... :-(
The bug is fixed in 1.5.6.

Thanks,
Nik

@niwo niwo closed this as completed Aug 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants