[chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: "knife-vsphere vm vmdk add" cannot find VM


Chronological Thread 
  • From: Anna Redding < >
  • To: " " < >
  • Subject: [chef] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: "knife-vsphere vm vmdk add" cannot find VM
  • Date: Mon, 24 Mar 2014 16:31:19 -0500

All - I don't know who will be happier me or you when I finally get this project completed...

As previously noted, I discovered there is a character limitation to the vsphere VM hostname  in order for the " knife-vsphere vm vmdk add ..." command to work.  (BTW:  Is this limitation documented somewhere? I can't find it)

So for testing purposes, I shortened the hostname and rebuilt the VM. The "knife-vsphere vm vmdk add ..." command does see the VM on the data store
BUT
 when it goes to create the first 'add-on' vmdk, it fails because it says it already exists.  

So, in summary:
- I tried putting the vmdk to a different data store than the primary vm's vmdk 

- The vmdk was created (VMname_1.vmdk)
BUT

- it fails  to attach the VMDK  to the VM with the following error:
     "undefined method 'deviceInfo' for nil:NilClass (NoMethodError)"

- tried to create another vmdk on a third data store 

It created the vmdk
BUT 

- it failed to attach to the VM with same error about the deviceInfo 
AND 
MORE IMPORTANTLY, 

- the vmdk suffix was not correctly incremented. (created as VMname_1.vmdk but
should have been VMname_2.vmdk)

So the two problems I'm seeing with the vmdk add option are:

1- additional VMDKs will not create on the same data store as the initial vm vmdk. Fails saying already exists 

2- additional VMDKs will create on separate data stores but do not properly attach to the master VM, do not recognize each others existence.  Fail with "undefined method 'deviceInfo'"

Are only certain disk device types recognized and are they documented somewhere?  What am I missing here?

HELP PLEASE!!!!!

Oh, also, I AM using the 0.9.8   knife-vsphere plugin. (I was having problem with 0.9.7 and upgraded). 

Here is my command (spaced out for readability):
knife vsphere vm vmdk add      
    AnnaHostVM
    4 
    --vmdk-type  thin 
    --vsdc  <vsDataCenter>   
    --vshost  <vsHost>   
    --target-lun  <datastore1>
    --vsport  443
    --vsinsecure 
    --verbose
    --config  ~/home/areddin/.chef  


I sure hope someone has some ideas....



Sent from my iPhone

On Mar 21, 2014, at 11:56 AM, Anna Redding < "> > wrote:

No, not using bundler. 
I will uninstall and see what the puts give me in the vmdk names. 

Also, do you happen to know what the character limitations are for hostnames, more specifically, VM names?


Sent from my iPhone

On Mar 21, 2014, at 11:46 AM, Robert Tsai < "> > wrote:

Hi Anna,

Glad to hear you found the issue.  Are you using bundler?  If not, you might want to just uninstall 0.9.7.

-Robert


On Fri, Mar 21, 2014 at 8:28 AM, Anna Redding < " target="_blank"> > wrote:
Robert, etal. 

Well, I finally figured out what was going on.  It appears there is a limit on the number of characters you can have in the hostname.  I took a shot in the dark and changed my VM name to 
annachefvm and it worked was able to find it. 

Now, though, I'm having another problem. When I create my VM, it is on, say, ds01, created as [ds01]annachefvm.vmdk. 
When I run the script to create the additional vmdk's, one of which is on ds01 which I believe  'should' create as:
[ds01]annachefvm_1.vmdk 
and another on ds02, which should create as:
[ds02]annachefvm_2.vmdk 
the command fails saying the vmdk already exists.  For some reason, it sees annachefvm already there and stops instead of creating it with the suffix.  (I have verified that there wasn't, by some fluke, already a vmdk out there by the same name)

Any suggestions?

And secondary to that, after installing knife-vsphere 0.9.8, it appears to still be executing 0.9.7
I confirmed 0.9.8 installed (gems list shows knife-vsphere (0.9.7,0.9.8)
How do I force it to use a specific version or am I suppose to uninstall 0.9.7 first (which I thought multiple version could exist due to other potential application requirements.). I know 0.9.8 isn't executing because I added some 'puts' and none of them executed. 

So suggestions for that as well would be much appreciated 

I'm so incredibly far behind in this. We only have a handful of people who know chef and the only one who has worked with the vsphere plugin is not available, plus being in a close area just makes it impossible to troubleshoot in a timely manner. Doing the work in an unclassified lab as suggested would be great but some of our contracts do not allow us to bill work done outside of the controlled area.  

Anyway, I digress with my whiney story.  I would truly appreciate any suggestions on the above two issues. 

Thanks again for the help, mostly for your patience as I bumble through this learning process  !!!  

Anna



Sent from my iPhone
Robert

Thank you for your line command. Unfortunately, it did not answer the issue but it told me that the next thing I was going to try wasn't going to work.  
When I printed the code for 0.9.8, I noticed references to the variable specifying the target lun was defined with an underscore as  "target_lun". 
I thought the might be the problem as I have been using a dash not an underscore ... but your example negated that because you use the 'dash' not the underscore. 

I cannot give exact command bc the system is in a secured area but I did write down the various pieces so here it is:

strace  -o  /tmp/strace-vsphere.out  knife  vsphere  vm  vmdk  add  annaVM  4   --vmdk-type  thick   --vsdc  ISP   --vshost  <vcIP>  --target-lun  ds03   --vsport  443   --vsinsecure  -VV 

When I looked at the strace, the DEBUG sections appeared to reflect the correct values.

After reviewing the 22k+ lines of strace info, I could not find any messages that jumped out, definitely none that were  preceded by the DEBUG flag. 

Any other ideas?
Anna



Sent from  my iPhone
Hi Anna,

Sorry to hear its still not working for you.  The command I used was knife vsphere vm vmdk add vmname 3 --target-lun SSDGuest

 knife vsphere vm vmdk  vmname 3 --target-lun SSDGuest
[fog][WARNING] Unable to load the 'unf' gem. Your AWS strings may not be properly encoded.
Digest::Digest is deprecated; use Digest
DEBUG: value for config item vsphere_host: 2.2.2.2
DEBUG: value for config item vshere_path:
DEBUG: value for config item vsphere_port: 443
DEBUG: value for config item vsphere_nossl:
DEBUG: value for config item vsphere_user: testuser
DEBUG: value for config item vsphere_pass: testpassword
DEBUG: value for config item vsphere_insecure: true
DEBUG: value for config item proxy_host:
DEBUG: value for config item proxy_port:
DEBUG: value for config item vsphere_host: 2.2.2.2
DEBUG: value for config item vshere_path:
DEBUG: value for config item vsphere_port: 443
DEBUG: value for config item vsphere_nossl:
DEBUG: value for config item vsphere_user: testuser
DEBUG: value for config item vsphere_pass: testpassword
DEBUG: value for config item vsphere_insecure: true
DEBUG: value for config item proxy_host:
DEBUG: value for config item proxy_port:
DEBUG: value for config item folder:
DEBUG: value for config item vsphere_dc: testdc

DEBUG: value for config item vsphere_dc: testdc
this is point1   * I added the puts to see what vm name would return
VirtualMachine("vm-981") *
this is point2  *
DEBUG: value for config item target_lun:
Datastore: SSDGuest (741.57 GB(796250865664) / 2.00 TB)
DEBUG: value for config item vsphere_dc: testbed
Choosing: SSDGuest
DEBUG: value for config item vmdk_type: thin
Next vmdk name is => [SSDGuest] vmname/vmname_1.vmdk
Creating VMDK
Capacity: 3 GB
Disk: [SSDGuest] vmname/vmname_1.vmdk
DEBUG: value for config item noop:
DEBUG: value for config item vsphere_dc: testbed
Attaching VMDK to vmname
using SCSI controller 0
using SCSI ID 1
DEBUG: value for config item noop:
D, [2014-03-20T10:11:57.458010 #26166] DEBUG -- : Shutdown completed cleanly

Can you output the command you used and the results?

Thanks,
Robert



On Thu, Mar 20, 2014 at 9:34 AM, Anna Redding < " target="_blank"> > wrote:
Robert,

Would you share your line command (substituting the proprietary info of course)?

I upgraded to 0.9.8 and still not working. It just has to be something with the command format/content. 

The "knife vsphere vm 'list' ..." works fine. The 'vmdk add' does not. 

Much appreciated,

Anna


Sent from my iPhone
What version of the pluggin are you using?  I am using 0.9.8 and I am able to use the knife vsphere vm vmdk add VM SIZE command with no issues.


On Tue, Mar 18, 2014 at 9:38 AM, Robert Tsai < " target="_blank"> > wrote:
btw Does the "knife vsphere vm state" command work for you?


On Tue, Mar 18, 2014 at 8:51 AM, Anna Redding < " target="_blank"> > wrote:
Yes I have tried that and it was either an invalid option or it failed (don't remember which). I have also tried --dest-folder which I used in the cloning step ... Also a no-go 


Sent from my iPhone
Hi Anna,

Have you tried adding the --folder FOLDER option where the vm resides? I haven't used the "knife vsphere vm vmdk add" command yet.  I'll test it and let you know if get the same results.
-Robert


On Tue, Mar 18, 2014 at 8:16 AM, Anna Redding < " target="_blank"> > wrote:
Thank you for replying.
> Post a verbose output
   Unfortunately I am running this in a closed area without Internet access.

> which call fails
The best I can tell using strace and the -vv option is the calls to PropertyFilterSpec.rb
TypeName.rb
PropertyPath.rb
ObjectSpec.rb
All fail with -1 return code and error "No such file or directory"
Then several lines of data that looks like registry or pointer values print out followed by the message
"Could not find <VMname>"


>
> Did you try knife-vsphere devs:
No, but now that I know there's a specific support group, I definitely will.


Let me know if the above triggers any ideas.

Thanks
Anna

Sent from my iPhone

On Mar 17, 2014, at 4:02 PM, Aimelyne Mochiron < " target="_blank"> > wrote:

> Hi Anna,
>
> Could you please post a verbose output (-VV flag)? At the least, knowing which call fails would be useful.
>
> Did you try and run your issue past the knife-vsphere devs: https://github.com/ezrapagel/knife-vsphere?
>
> am
>
> On 17 Mar 2014, at 19:25, Anna Redding < " target="_blank"> > wrote:
>
>> Hello all,
>>
>> I have not heard anything back so re-posting.
>>
>> I 'really' need to get this resolved (see atached email) as the automation code I've written needs to be used to build out an environment tomorrow or Wed. We will have to have manual intervention if I don't get this working and that is what we are trying to eliminate.
>>
>> So ANY' ideas are most welcome!!!!
>>
>> I've tried putting the VM directly under the data center level; I've tried referencing via  IPaddr; I've tried the long form of the hostname; I've verified spelling; I've verified the VM is really on the data store I'm pointing to on the command line... no matter what, I receive the same error indicating it cannot find the VM...yet it was created using the "knife vsphere vm clone" command.
>>
>> What else can it be???
>>
>> Even if you think it's an 'obvious' answer, please run it past me.
>>
>> Thank you in advance.
>> Anna
>>
>>
>> Sent from my iPhone
>>
>> On Mar 14, 2014, at 11:14 AM, Anna Redding < " target="_blank"> > wrote:
>>
>>> All
>>>
>>> Once again, I am perplexed. After cloning my VMs from template (via a script using 'knife vsphere vm clone...'), I am trying to add additional vmdks to each VM so we can create additional mount points on different virtual disks.
>>>
>>> Again, I am using 'knife vsphere' but with the vm vmdk add' arguments. It is erroring stating it cannot find the VM.
>>>
>>> I have verified the VM is on the data store.  I have verified in vcenter, the VM is under the expected folder.
>>>
>>> When I issue the command 'knife vsphere vm vmdk list --recursive ...', I see the VM and it is under the expected folder (called VMbuildout)....
>>> But when I execute the command:
>>> 'knife vsphere vm vmdk add  <VM>...'
>>> It errors with "Cannot find <VM>"
>>>
>>> Oh, also, there are NO special characters in the VM's name.
>>>
>>> So...what am I missing here???
>>>
>>> Thanks in advance,
>>> Anna
>>>
>>>
>>> Sent from my iPhone
>








Archive powered by MHonArc 2.6.16.

§